From 074a08075e7c1b3ad3c1e0b2930f5391c0b1a3cf Mon Sep 17 00:00:00 2001 From: PeachScript Date: Thu, 20 Aug 2020 14:15:30 +0800 Subject: [PATCH] fix(assets): async for assets command --- packages/preset-dumi/src/plugins/commands/assets.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/preset-dumi/src/plugins/commands/assets.ts b/packages/preset-dumi/src/plugins/commands/assets.ts index 72c9360386..008a9d25e8 100644 --- a/packages/preset-dumi/src/plugins/commands/assets.ts +++ b/packages/preset-dumi/src/plugins/commands/assets.ts @@ -22,13 +22,13 @@ export default (api: IApi) => { */ api.registerCommand({ name: 'assets', - fn({ args }) { + async fn({ args }) { const assetsOutputPath = path.resolve(api.paths.cwd, args._[0] || 'assets.json'); const fileName = path.parse(assetsOutputPath).base; api.logger.log(`Start to generate ${fileName}...`); - getRouteConfig(api, ctx.opts); + await getRouteConfig(api, ctx.opts); fs.writeFileSync(assetsOutputPath, JSON.stringify(assetsPkg, null, 2)); api.logger.log(`Generate ${fileName} successfully!`);