【发布时间】:2018-11-22 21:48:10
【问题描述】:
我将 .babelrc 配置为类似的东西
{
"env" : {
"test": {
"plugins": [some other plugins...] //but not lodash
}
"plugins": ["lodash", some other plugins ...]
}
但此配置不起作用。如果我在 cli BABEL_ENV=test <command> 上给出了 lodash 仍然会附带它。
我什至在测试中尝试过"exclude": ["babel-plugin-lodash"]。从测试环境中排除 lodash 但不在默认运行中的正确方法是什么?
我正在尝试解决this issue。
我尝试了那里建议的解决方法,但我也希望 lodash 在默认运行中。这里的默认意思是在命令行中没有 BABEL_ENV=<env>。
【问题讨论】:
-
"exclude": ["bable-plugin-lodash"]包含一个错字。应该是 babel. -
错字只是在这里而不是在实际代码中