-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvue.config.js
85 lines (81 loc) · 2.26 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const fs = require('fs');
module.exports = {
"transpileDependencies": [
"vuetify"
],
publicPath: './',
configureWebpack: {
plugins: [
],
externals: { ws: "WebSocket" },
output: {
filename: '[name].[hash].js',
},
optimization: {
runtimeChunk: 'single',
splitChunks: {
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 0,
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name(module) {
// get the name. E.g. node_modules/packageName/not/this/part.js
// or node_modules/packageName
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
// npm package names are URL-safe, but some servers don't like @ symbols
return `yarn.${packageName.replace('@', '')}`;
},
},
},
},
},
},
css: {
loaderOptions: {
sass: {
prependData: `@import "~@/sass/main.scss"`,
},
},
},
chainWebpack: config => {
["vue-modules", "vue", "normal-modules", "normal"].forEach((match) => {
config.module.rule('scss').oneOf(match).use('sass-loader')
.tap(opt => Object.assign(opt, { prependData: `@import '~@/sass/main.scss';` }))
})
},
// configure webpack-dev-server behavior
devServer: {
before: app => {},
clientLogLevel: 'warning',
compress: true,
host: '0.0.0.0',
public: 'http://0.0.0.0:6100',
disableHostCheck: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers':
'X-Requested-With, content-type, Authorization'
},
// Uncomment this https block below to enable https in the Maverick environment
/*
https: {
key: fs.readFileSync('/srv/maverick/data/security/ssl/web/mavweb.key'),
cert: fs.readFileSync('/srv/maverick/data/security/ssl/web/mavweb.crt'),
ca: fs.readFileSync('/srv/maverick/data/security/ssl/ca/mavCA.pem'),
},
*/
https: false,
hotOnly: true,
inline: true,
open: false,
overlay: {
warnings: true,
errors: true
},
port: 6100,
proxy: null
},
}