Skip to content

Commit

Permalink
fix(cli): 处理 lodash/fp 的小程序端兼容问题
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Oct 1, 2018
1 parent 38a6d76 commit fb10108
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/taro-cli/src/util/resolve_npm_files.js
Expand Up @@ -188,7 +188,8 @@ function npmCodeHack (filePath, content) {
switch (basename) {
case 'lodash.js':
case '_global.js':
content = content.replace('Function(\'return this\')()', 'this')
case 'lodash.min.js':
content = content.replace(/Function\([\'"]return this[\'"]\)\(\)/, 'this')
break
case '_html.js':
content = 'module.exports = false;'
Expand Down

0 comments on commit fb10108

Please sign in to comment.