webpack4 设置mode模式为none 提示没有设置mode切换为developmentvue项目中使用DLL打包vue避免每次打包都要重新build第三方库,执行脚本的时候会报错,webpack提示没有设置mode 默认设置成了development,导致entry的路径不是设置的vendor,虽然打包成功了,但是会多一个development中的entry文件相关代码webpack.dll.conf.js 相关代码const dllWebpackConf = {entry: {vendor: ['vue/dist/vue.esm.js']},output: {filename: '[name].dll.js',path: path.resolve(__dirname, '../dist/dll'),library: '[name]'},plugins: [new Webpack.DllPlugin({ path: path.join(__dirname, '../dist/dll', '[name]-manifest.json'),
name: '[name]'})]}执行脚本webpack ---mode=none --config build/webpack.dll.conf.jsWARNING in configurationThe 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production'to enable defaults for each environment.dist目录中dll存放的是打包好的vue文件,同时会多一个main.js,求解为什么不能设置none。
2 回答
狐的传说
TA贡献1804条经验 获得超3个赞
请问这个解决了没有,
vue-cli2 webpack4 设置"dll":
"webpack --mode none --config ./build/webpack.dll.config.js",
直接报:webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead. 请问怎么解决?
添加回答
举报
0/150
提交
取消