mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-05 19:41:57 +08:00
fix: 监听icons文件夹变更,进行重新编译
This commit is contained in:
parent
9b52d18b19
commit
5beef07281
@ -1,9 +1,9 @@
|
||||
{{#ICON_NAMES}}
|
||||
import smile from './icons/{{.}}';
|
||||
import {{.}} from './icons/{{.}}';
|
||||
{{/ICON_NAMES}}
|
||||
|
||||
export default {
|
||||
{{#ICON_NAMES}}
|
||||
{{.}}
|
||||
{{.}},
|
||||
{{/ICON_NAMES}}
|
||||
};
|
@ -17,7 +17,9 @@ export default (api) => {
|
||||
const namespace = 'plugin-icon';
|
||||
const absRuntimeFilePath = join(namespace, 'runtime.js');
|
||||
|
||||
// TODO 监听 icons 文件变更,重新生成文件
|
||||
// 监听 icons 文件变更,重新生成文件
|
||||
api.addTmpGenerateWatcherPaths(() => join(api.paths.absSrcPath, 'icons'));
|
||||
|
||||
api.onGenerateFiles(async () => {
|
||||
const base = join(api.paths.absSrcPath, 'icons');
|
||||
const iconFiles = api.utils.glob.sync('**/*', {
|
||||
|
@ -32,7 +32,7 @@ export default async ({ api, watch }) => {
|
||||
'all',
|
||||
lodash.throttle(async () => {
|
||||
await generate();
|
||||
}, 100),
|
||||
}, 100)
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user