解决Webpack中提示syntax 'classProperties' isn't currently enabled的错误

时间:2018-11-11 15:31:59   收藏:0   阅读:3640

当我们使用了一些JavaScript的一些新特性的时候,但是有没有在webpack.config.js里面或者是.babelrc文件中配置相关插件,就可以解决了。

error:Support for the experimental syntax ‘classProperties‘ isn‘t currently enable

  

解决方案:安装如下插件

npm i -D @babel/plugin-proposal-class-properties

 

在babelrc中配置插件:

options: {
        plugins: [‘@babel/plugin-proposal-class-properties‘]
         }
       },

  

再次运行程序,发现之前的问题就没有了。

原文:https://www.cnblogs.com/52tech/p/9942170.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!