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.
66 lines
1.4 KiB
66 lines
1.4 KiB
|
|
const path = require('path')
|
|
const TerserPlugin = require('terser-webpack-plugin')
|
|
|
|
module.exports = {
|
|
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/')
|
|
}
|
|
}
|
|
},
|
|
chainWebpack: config => {
|
|
config.module
|
|
.rule('vue')
|
|
.use('vue-loader')
|
|
.loader('vue-loader')
|
|
.tap(options => {
|
|
options.compilerOptions = {
|
|
...(options.compilerOptions || {}),
|
|
whitespace: 'preserve',
|
|
preserveWhitespace: false
|
|
}
|
|
return options
|
|
})
|
|
}
|
|
}
|
|
|