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.

50 lines
1.0 KiB

const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
3 months ago
// publicPath: '/new/',
devServer: {
proxy: {
'/api': {
target: 'http://jasonyizherenxin.checkcopy.com',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
},
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/')
}
}
},
};