Merge branch 'master' of https://github.com/WeBankFinTech/fes.js
@ -3,7 +3,7 @@ English | [简体中文](./README.md)
|
||||
|
||||
<p align="center">
|
||||
<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>
|
||||
</p>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<p align="center">
|
||||
<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>
|
||||
</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 { 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) {
|
||||
const {
|
||||
paths,
|
||||
@ -33,12 +43,11 @@ export default function (api) {
|
||||
'onRouterCreated'
|
||||
]
|
||||
});
|
||||
const appPath = winPath(join(paths.absSrcPath, 'app.js'));
|
||||
const plugins = await api.applyPlugins({
|
||||
key: 'addRuntimePlugin',
|
||||
type: api.ApplyPluginsType.add,
|
||||
initialValue: [
|
||||
existsSync(appPath) && appPath
|
||||
getAppPath(paths.absSrcPath)
|
||||
].filter(Boolean)
|
||||
});
|
||||
api.writeTmpFile({
|
||||
|
@ -44,9 +44,8 @@ export default async ({ api, watch }) => {
|
||||
type: api.ApplyPluginsType.add,
|
||||
initialValue: [
|
||||
paths.absPagesPath,
|
||||
// 貌似没用到
|
||||
// join(paths.absSrcPath, api.config?.singular ? 'layout' : 'layouts'),
|
||||
join(paths.absSrcPath, 'app.js')
|
||||
join(paths.absSrcPath, 'app.js'),
|
||||
join(paths.absSrcPath, 'app.ts')
|
||||
]
|
||||
});
|
||||
lodash
|
||||
|