首页
Javascript
Html
Css

Node.js

Electron
移动开发
小程序
工具类
服务端
浏览器相关
前端收藏
其他
关于
公司注册

rollup报错:The 'typeof' Babel helper is used more than once in your code

2019年06月14日 发布 阅读(2065) 作者:Jerman

使用rollup报:

The ‘typeof’ Babel helper is used more than once in your code. It’s strongly recommended that you use the “external-helpers” plugin or the “es2015-rollup” preset. See https://github.com/rollup/rollup-plugin-babel#configuring-babel for more information

解决

  1. // .babelrc
  2. {
  3. "presets": [
  4. [
  5. "env",
  6. {
  7. "modules": false
  8. }
  9. ]
  10. ],
  11. "plugins": ["external-helpers"]
  12. }

使用external-helpers必须要先安装

  1. npm install --save-dev babel-plugin-external-helpers
版权声明:本站文章除特别声明外,均采用署名-非商业性使用-禁止演绎 4.0 国际 许可协议,如需转载,请注明出处