forked from qingqingxuan/vue-admin-work-x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
38 lines (38 loc) · 959 Bytes
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// eslint-disable-next-line @typescript-eslint/no-var-requires
const CompressionPlugin = require("compression-webpack-plugin")
console.log(process.env.NODE_ENV)
module.exports = {
publicPath: process.env.NODE_ENV === 'development' ? '/' : "/vue-admin-work-x",
outputDir: "dist",
assetsDir: "static",
lintOnSave: true,
productionSourceMap: false,
devServer: {
hot: true,
port: 5567,
open: true,
},
configureWebpack: {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
}
]
}
},
chainWebpack(config) {
if (process.env.NODE_ENV === 'production') {
config.plugin('compressionPlugin')
.use(new CompressionPlugin({
filename: '[path].gz[query]',
algorithm: 'gzip',
test: /\.js$|\.html$|\.css/,
threshold: 50240,
deleteOriginalAssets: false
}))
}
}
};