Skip to content

Commit

Permalink
fix(cli): 修复将 node_modules 中的文件当成普通文件重复编译的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Feb 25, 2019
1 parent 7b3bcc5 commit 2323266
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/taro-cli/src/weapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,9 @@ const shouldTransformAgain = (function () {
})()

async function compileScriptFile (content, sourceFilePath, outputFilePath, adapter) {
if (NODE_MODULES_REG.test(sourceFilePath) && fs.existsSync(outputFilePath)) {
return fs.readFileSync(outputFilePath)
}
const compileScriptRes = await npmProcess.callPlugin('babel', content, sourceFilePath, babelConfig)
const code = compileScriptRes.code
if (!shouldTransformAgain) {
Expand Down

0 comments on commit 2323266

Please sign in to comment.