-
Notifications
You must be signed in to change notification settings - Fork 16
/
vue.config.js
61 lines (53 loc) · 1.86 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* eslint-disable @typescript-eslint/no-var-requires */
const LCL = require('last-commit-log')
const path = require('path')
try {
const lcl = new LCL()
const commit = lcl.getLastCommitSync()
process.env.VUE_APP_GIT_HASH = commit.hash
process.env.VUE_APP_GIT_DATE = commit.committer.date
} catch (_) {
process.env.VUE_APP_GIT_DATE = Date.now()
}
// eslint-disable-next-line @typescript-eslint/no-var-requires
process.env.VUE_APP_VERSION = require('./package.json').version
// eslint-disable-next-line @typescript-eslint/no-var-requires
const socialMediaDesc = require('./src/assets/data/social-media-desc.json')
process.env.VUE_APP_TITLE = socialMediaDesc.title
process.env.VUE_APP_DESCRIPTION = socialMediaDesc.description
process.env.VUE_APP_MAIN_URL = socialMediaDesc.url
process.env.VUE_APP_IMG_ALT_TEXT = socialMediaDesc.imgAltText
process.env.VUE_APP_TWITTER = socialMediaDesc.twitter
process.env.VUE_APP_AUTHORS = socialMediaDesc.authors
module.exports = {
chainWebpack: (config) => {
// make sure babel-loader is not confused when using "yarn link"
config.resolve.symlinks(false)
// Force all instances of vue to be resolved as single module.
// Multiple instances can be present when using "yarn link".
config.resolve.alias.set('vue', path.dirname(require.resolve('vue')))
const vueRule = config.module.rule('vue')
const svgRule = config.module.rule('svg')
const prevConfig = svgRule.toConfig()
svgRule.uses.clear()
svgRule
.oneOf('inline')
.resourceQuery(/\?inline/)
.merge(vueRule.toConfig())
.test(undefined)
.use('vue-svg-loader')
.loader('vue-svg-loader')
.end()
.end()
.oneOf('external')
.merge(prevConfig)
.test(undefined)
},
css: {
loaderOptions: {
scss: {
additionalData: `@import "~@/assets/styles/global.scss";`,
},
},
},
}