mirror of
https://github.com/himool/HimoolERP.git
synced 2024-11-15 11:58:42 +08:00
37 lines
No EOL
846 B
JavaScript
37 lines
No EOL
846 B
JavaScript
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',
|
|
'qs': 'Qs',
|
|
'moment': 'moment',
|
|
'number-precision': 'NP',
|
|
'@antv/g2': 'Chart',
|
|
'html2canvas': 'html2canvas',
|
|
'jspdf': 'jspdf',
|
|
},
|
|
plugins: [
|
|
new CompressionWebpackPlugin({
|
|
algorithm: 'gzip',
|
|
test: /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i,
|
|
threshold: 2048,
|
|
deleteOriginalAssets: false,
|
|
minRatio: 0.8
|
|
})]
|
|
},
|
|
devServer: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
},
|
|
} |