当我们使用了一些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']
         }
       },

  

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

相关文章:

  • 2021-11-20
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-10-30
猜你喜欢
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-04-17
相关资源
相似解决方案