// const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
publicPath: process.env.NODE_ENV === 'production'
? './'
: '/'
,devServer: {
publicPath: '/',
open: true
},
// 打正式包时不生成map文件 提升打包速度
productionSourceMap: false,
//webpack配置
configureWebpack: config => {
//调试JS
config.devtool = "source-map";
config['performance'] = {
hints:'warning',
//入口起点的最大体积
maxEntrypointSize: 50000000,
//生成文件的最大体积
maxAssetSize: 30000000,
//只给出 js 文件的性能提示
assetFilter: function(assetFilename) {
return assetFilename.endsWith('.js');
}
}
/*config['plugins'] = [
new HtmlWebpackPlugin({
// filename: 'index.html',
// template: 'index.html'
// inject: true
})
]*/
},
chainWebpack: config => {
config
.plugin('html')
.tap(args => {
args[0].title= '综合电力监控管理系统'
return args
})
},
css: {
//查看CSS属于哪个css文件
sourceMap: true
}
}