Skip to content

Commit

Permalink
fix(webpack-runner): add esnextModules regex support the modules of c…
Browse files Browse the repository at this point in the history
…npm installed (#1796)
  • Loading branch information
onelong authored and luckyadam committed Jan 3, 2019
1 parent 854c0be commit 1bcb017
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/taro-webpack-runner/src/util/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ const getModule = ({

const isNodemodule = filename => /\bnode_modules\b/.test(filename)
if (Array.isArray(esnextModules) && esnextModules.length) {
const esnextModuleRegs = esnextModules.map(v => new RegExp(`node_modules[\\\\/]${v}`))
/* cnpm 安装的模块名前带下划线 `_` */
const esnextModuleRegs = esnextModules.map(v => new RegExp(`node_modules[\\\\/]_?${v}`));
/**
* isEsnextModule
*
Expand Down

0 comments on commit 1bcb017

Please sign in to comment.