webpack打包时报错:Support for the experimental syntax 'classProperties' isn't currently enabled
在写react项目创建class时使用了静态属性,但是在打包的时候报错:
根据报错提示下载@babel/plugin-proposal-class-properties包,并在.babelrc文件中的"plugins"里添加一项"@babel/plugin-proposal-class-properties"
{ "presets": ["@babel/preset-env", "@babel/preset-react"], "plugins": ["@babel/plugin-transform-runtime","@babel/plugin-proposal-class-properties"] }
重新打包即可。