-
Notifications
You must be signed in to change notification settings - Fork 7
/
vue.config.js
68 lines (61 loc) · 1.44 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
62
63
64
65
66
67
68
const path = require('path')
module.exports = {
publicPath: '',
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'locales',
enableInSFC: true
}
},
css: {
loaderOptions: {
scss: {
prependData: `
@import "@/scss/_variables.scss";
@import "@/scss/_fonts.scss";
@import "@/scss/_medias.scss";
@import "@/scss/_mixins.scss";
`
}
}
},
devServer: {
disableHostCheck: true,
watchOptions: {
clientLogLevel: 'warning'
}
},
chainWebpack: config => {
// Add "node_modules" alias
config.resolve.alias
.set('node_modules', path.join(__dirname, './node_modules'))
// Disable "prefetch" plugin since it's not properly working in some browsers
config.plugins
.delete('prefetch')
config.module
.rule('raw')
.test(/\.txt$/i)
.use('raw-loader')
.loader('raw-loader')
.end()
config.plugin('copy')
.tap(args => {
args[0].push({
from: path.resolve(__dirname, 'cfg/schema.json'),
to: path.resolve(__dirname, 'dist/schema'),
toType: 'dir'
})
return args
})
// Do not remove whitespaces
config.module.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.whitespace = 'preserve'
return options
})
}
}