From ccb4e675ab8e33cafb5374f9db4c602c380ccc31 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Wed, 7 Dec 2022 18:52:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(cli):=20=E6=8F=92=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81ts=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli/src/utils/resolveAppPackages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/utils/resolveAppPackages.ts b/packages/cli/src/utils/resolveAppPackages.ts index 5002fa31..32294406 100644 --- a/packages/cli/src/utils/resolveAppPackages.ts +++ b/packages/cli/src/utils/resolveAppPackages.ts @@ -63,7 +63,7 @@ export const resolveAppPackages = (app: App): ModuleMainFilePath => { return; } const indexCode = fs.readFileSync(i.indexPath, { encoding: 'utf-8', flag: 'r' }); - const ast = recast.parse(indexCode); + const ast = recast.parse(indexCode, { parser: require('recast/parsers/typescript') }); if (typeAssertion({ ast, indexPath }).type === PackageType.PLUGIN) { // 插件 pluginMap[i.type] = i.indexPath;