forked from maomao1996/Vue-mmPlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
43 lines (39 loc) · 1.05 KB
/
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
39
40
41
42
43
const path = require('path')
const dayjs = require('dayjs')
function resolve(dir) {
return path.join(__dirname, dir)
}
const isEnvProduction = process.env.NODE_ENV === 'production'
// 注入版本信息
process.env.VUE_APP_VERSION = require('./package.json').version
// 注入版本更新时间
process.env.VUE_APP_UPDATE_TIME = dayjs()
.locale('zh-cn')
.format('YYYY-MM-DD')
module.exports = {
publicPath: '',
chainWebpack(config) {
config.resolve.alias
.set('api', resolve('src/api'))
.set('assets', resolve('src/assets'))
.set('base', resolve('src/base'))
.set('components', resolve('src/components'))
.set('pages', resolve('src/pages'))
config.plugin('html').tap(args => {
if (isEnvProduction) {
args[0].minify.minifyJS = true
args[0].minify.minifyCSS = true
}
return args
})
},
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [
resolve('src/styles/var.less'),
resolve('src/styles/mixin.less')
]
}
}
}