You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
51 lines
1.1 KiB
const path = require('path');
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
module.exports = {
|
|
// publicPath: '/new/',
|
|
devServer: {
|
|
proxy: {
|
|
'/supernew': {
|
|
target: 'http://adminnew.pengda.checkcopy.com/',
|
|
changeOrigin: true,
|
|
},
|
|
'/agentnew': {
|
|
target: 'http://kuaile.checkcopy.com',
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
},
|
|
configureWebpack: {
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
optimization: {
|
|
minimizer: [
|
|
new TerserPlugin({
|
|
terserOptions: {
|
|
format: {
|
|
comments: /^\**!|@preserve|@license|@cc_on/i // 保留特定注释
|
|
}
|
|
},
|
|
extractComments: false // 不提取注释到单独文件
|
|
})
|
|
]
|
|
},
|
|
output: {
|
|
filename: '[name].[contenthash:8].js',
|
|
chunkFilename: '[name].[contenthash:8].js'
|
|
},
|
|
resolve:{
|
|
alias:{
|
|
'@':path.resolve(__dirname, 'src/')
|
|
}
|
|
}
|
|
},
|
|
};
|