diff --git a/packages/wxa-cli/src/resolvers/ast/index.js b/packages/wxa-cli/src/resolvers/ast/index.js index c8c38c38..e7e293ae 100644 --- a/packages/wxa-cli/src/resolvers/ast/index.js +++ b/packages/wxa-cli/src/resolvers/ast/index.js @@ -126,12 +126,13 @@ export default class ASTManager { case StringLiteralRequire: // path.replaceWithSourceString(`require("${resolved}")`); path.replaceWith( template(`require(SOURCE)`)({SOURCE: t.stringLiteral(resolved)}) ); + path.stop(); break; case ImportDeclaration: path.get('source').replaceWith(t.stringLiteral(resolved)); + path.skip(); break; } - path.stop(); } catch (e) { logger.error('解析失败', e); debug('resolve fail %O', e);