使用 cordova 打包的时候,出现了下面问题:
Error happened when webpack build: Error: Command failed: xxx --env.release
clean-webpack-plugin: www has been removed.
之前打包 debug 是没问题的,切换到 release 就出问题了。
StackOverflow 看了下好像有回答,但是没看懂,后面再 GitHub 上有个 issue 里面讲了个解决办法,试了下好像没效果,使用起来如下:
删除 package-lock.json 文件
重新使用 npm install
最后发下好像并不是这些东西有问题,问了下说是 JS 的混淆有问题,注释了根目录下 webpack.config.js 文件里面的一些内容就好了。应该就是 StackOverflow 里面讲的东西吧,前端内容不是很懂。
https://stackoverflow.com/questions/43261320/webpack-clean-public-js-has-been-removed
https://github.com/caiobiodere/cordova-template-framework7-vue-webpack/issues/55