请问如何在lavas.config.js里配置webpack??
Closed this issue · 1 comments
silence-may commented
PengXing commented
线下 QQ 沟通已解决,我把解决方法写在这里
修改 lavas.config.js,在 build 中增加 extendWithWebpackChain
函数配置,参考 https://lavas.baidu.com/guide/v2/advanced/build-config#extendwithwebpackchain
extendWithWebpackChain(config, {type, env}) {
config.plugin('uglify-js').use(UglifyJSPlugin, [{
parallel: true, // enable `parallel` option
sourceMap: true,
uglifyOptions: {
mangle: {
keep_fnames: true,
safari10: true,
reserved: ['Buffer']
}
}
}]);
}