Skip to content

Commit

Permalink
fix(taro-cli): 修复插件 prod 模式下编译问题,fix #4231
Browse files Browse the repository at this point in the history
编译时替换静态资源的正则改成非贪婪模式
  • Loading branch information
Chen-jj committed Sep 17, 2019
1 parent dcb102e commit 4564acd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-cli/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ async function buildWxPlugin (appPath, { watch }) {
return $1 === '../' ? str.replace('../', './') : str.replace('../', '')
})

const REG_PLUGIN_DEPS = RegExp(`['|"](/${PLUGIN_ROOT}.+)['|"]`, 'g')
const REG_PLUGIN_DEPS = RegExp(`['|"](/${PLUGIN_ROOT}.+?)['|"]`, 'g')
replacement = replacement.replace(REG_PLUGIN_DEPS, (str, $1) => {
if (REG_FONT.test($1) || REG_IMAGE.test($1) || REG_MEDIA.test($1)) {
isShouldBeWritten = true
Expand Down

0 comments on commit 4564acd

Please sign in to comment.