Skip to content

Commit

Permalink
Merge pull request #44 from wxajs/fix-#43
Browse files Browse the repository at this point in the history
Fix #43
  • Loading branch information
Genuifx committed Jan 9, 2020
2 parents fbf5a72 + 5beb1d3 commit 1675fe6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/wxa-cli/src/resolvers/ast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1675fe6

Please sign in to comment.