-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
40 lines (33 loc) · 1.3 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
const { defineConfig } = require('@vue/cli-service')
const pkg = require('./package.json')
const date = new Date()
module.exports = defineConfig({
transpileDependencies: true,
pages: {
index: {
entry: 'src/main.js',
experience: new Date().getFullYear() - 2009,
firstName: process.env.VUE_APP_FIRST_NAME,
measurementId: process.env.MEASUREMENT_ID,
title: `${process.env.VUE_APP_FIRST_NAME} Sapan`,
},
},
chainWebpack: (config) => {
config.plugin('eslint').tap((args) => {
args[0].fix = true
return args
})
config.module.rule('js')
.test(/\.js$/)
.use('webpack-import-glob-loader')
.loader('webpack-import-glob-loader')
config.plugin('define').tap((args) => {
args[0]['process.env'] = {
...args[0]['process.env'],
VUE_APP_VERSION: `"${pkg.version}"`,
VUE_APP_BUILD_TIMESTAMP: `"${date.toLocaleString('default', { month: 'short' })} ${date.getDate()} ${date.getFullYear()}, ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}"`,
}
return args
})
},
})