在webpack4 中利用Babel 7取消严格模式方法

项目引用mui.js报错Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be...

安装:

cnpm i @babel/plugin-transform-modules-commonjs @babel/plugin-transform-strict-mode -D

 

在.babelrc中进行配置:

"plugins": [
      ["@babel/plugin-transform-modules-commonjs", { "strictMode": false }]
    ]

要注意版本,版本不一样,而你又没注意 用npm i babel-plugin-transform-remove-strict-mode -D
"plugins": [ "transform-remove-strict-mode" ]
真的会捣腾一天
posted @ 2020-08-09 16:19  webapp1  阅读(395)  评论(0编辑  收藏  举报