2021-12-24 14:02:36 +08:00
|
|
|
const CompressionWebpackPlugin = require('compression-webpack-plugin');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
assetsDir: 'static',
|
|
|
|
configureWebpack: {
|
|
|
|
externals: {
|
|
|
|
'ant-design-vue': 'Antd',
|
|
|
|
'vue-router': 'VueRouter',
|
|
|
|
'js-cookie': 'Cookies',
|
|
|
|
'axios': 'axios',
|
|
|
|
'vue': 'Vue',
|
|
|
|
'moment': 'moment',
|
|
|
|
'number-precision': 'NP',
|
|
|
|
'vuex': 'Vuex',
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CompressionWebpackPlugin({
|
|
|
|
algorithm: 'gzip',
|
|
|
|
test: /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i,
|
|
|
|
threshold: 2048,
|
|
|
|
deleteOriginalAssets: false,
|
|
|
|
minRatio: 0.8
|
|
|
|
})]
|
|
|
|
},
|
|
|
|
css: {
|
|
|
|
loaderOptions: {
|
|
|
|
less: {
|
|
|
|
javascriptEnabled: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
devServer: {
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
2022-03-13 13:40:16 +08:00
|
|
|
target: 'http://114.218.158.78:12223',
|
|
|
|
// target: 'http://127.0.0.1:8000',
|
2021-12-24 14:02:36 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|