Cannot assign to read only property 'exports' of object at webpack ....BaseClient

网上找了很多资料说是import和export不能一起用,改代码

其实根本原因是es6和es5混合使用造成的兼容性问题

只需要配置.babelrc就可以了

首先安装 

npm install -D transform-es2015-modules-commonjs
 
然后配置.babelrc
"plugins": ["transform-es2015-modules-commonjs"]
 
ok,就这样解决了
原文地址:https://www.cnblogs.com/cyundan/p/11430319.html