Merge branch 'master' of https://github.com/WeBankFinTech/fes.js
@ -3,7 +3,7 @@ English | [简体中文](./README.md)
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="../../">
|
<a href="../../">
|
||||||
<img alt="fes.js" width="250" src="https://i.loli.net/2021/03/12/Vb4LKc5gaHUfOwB.png">
|
<img alt="fes.js" width="250" src="./images/fes-logo.png">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="../../">
|
<a href="../../">
|
||||||
<img alt="fes.js" width="250" src="https://i.loli.net/2021/03/12/Vb4LKc5gaHUfOwB.png">
|
<img alt="fes.js" width="250" src="./images/fes-logo.png">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 50 KiB |
BIN
images/fes-logo-name.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
images/fes-logo.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
images/hexo.png
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 50 KiB |
@ -3,6 +3,16 @@ import { join } from 'path';
|
|||||||
import { winPath } from '@fesjs/utils';
|
import { winPath } from '@fesjs/utils';
|
||||||
import { runtimePath } from '../../../../utils/constants';
|
import { runtimePath } from '../../../../utils/constants';
|
||||||
|
|
||||||
|
function getAppPath(absSrcPath) {
|
||||||
|
for (const suffix of ['.js', '.ts', '.jsm']) {
|
||||||
|
const p = winPath(join(absSrcPath, `app${suffix}`));
|
||||||
|
if (existsSync(p)) {
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
export default function (api) {
|
export default function (api) {
|
||||||
const {
|
const {
|
||||||
paths,
|
paths,
|
||||||
@ -33,12 +43,11 @@ export default function (api) {
|
|||||||
'onRouterCreated'
|
'onRouterCreated'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
const appPath = winPath(join(paths.absSrcPath, 'app.js'));
|
|
||||||
const plugins = await api.applyPlugins({
|
const plugins = await api.applyPlugins({
|
||||||
key: 'addRuntimePlugin',
|
key: 'addRuntimePlugin',
|
||||||
type: api.ApplyPluginsType.add,
|
type: api.ApplyPluginsType.add,
|
||||||
initialValue: [
|
initialValue: [
|
||||||
existsSync(appPath) && appPath
|
getAppPath(paths.absSrcPath)
|
||||||
].filter(Boolean)
|
].filter(Boolean)
|
||||||
});
|
});
|
||||||
api.writeTmpFile({
|
api.writeTmpFile({
|
||||||
|
@ -44,9 +44,8 @@ export default async ({ api, watch }) => {
|
|||||||
type: api.ApplyPluginsType.add,
|
type: api.ApplyPluginsType.add,
|
||||||
initialValue: [
|
initialValue: [
|
||||||
paths.absPagesPath,
|
paths.absPagesPath,
|
||||||
// 貌似没用到
|
join(paths.absSrcPath, 'app.js'),
|
||||||
// join(paths.absSrcPath, api.config?.singular ? 'layout' : 'layouts'),
|
join(paths.absSrcPath, 'app.ts')
|
||||||
join(paths.absSrcPath, 'app.js')
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
lodash
|
lodash
|
||||||
|