forked from bugy/script-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
114 lines (100 loc) · 3.25 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
const webpack = require('webpack');
module.exports = {
// don't set absolute paths, otherwise reverse proxies with a custom path won't work
publicPath: '',
outputDir: '../web',
devServer: {
proxy: {
'': {
target: 'http://localhost:5000'
},
'/': {
target: 'ws://localhost:5000',
ws: true,
headers: {
Origin: 'http://localhost:5000'
}
}
}
},
pages: {
index: {
entry: 'src/main-app/index.js',
template: 'public/index.html',
chunks: ['chunk-index-vendors', 'index']
},
admin: {
entry: 'src/admin/admin.js',
template: 'public/admin.html',
chunks: ['chunk-admin-vendors', 'admin']
},
login: {
entry: 'src/login/login.js',
template: 'public/login.html',
chunks: ['chunk-login-vendors', 'login']
}
},
css: {
loaderOptions: {
scss: {
additionalData: '@import "./src/assets/css/color_variables.scss"; '
+ '@import "materialize-css/sass/components/_variables.scss"; '
+ '@import "materialize-css/sass/components/_global.scss"; '
+ '@import "materialize-css/sass/components/_typography.scss"; '
}
}
},
configureWebpack: {},
chainWebpack: config => {
const options = module.exports;
const pages = options.pages;
const pageKeys = Object.keys(pages);
const IS_VENDOR = /[\\/]node_modules[\\/]/;
// ATTENTION! do not use minSize/maxSize until vue-cli moved to the 4th version of html-webpack-plugin
// Otherwise plugin won't be able to find split packages
config.optimization
.splitChunks({
cacheGroups: {
...pageKeys.map(key => ({
name: `chunk-${key}-vendors`,
priority: -11,
chunks: chunk => chunk.name === key,
test: IS_VENDOR,
enforce: true
}))
}
});
},
pluginOptions: {
karma: {
files: ['tests/unit/index.js'],
customLaunchers: {
ChromeHeadless: {
base: 'Chrome',
flags: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--remote-debugging-port=9222'
]
}
},
browsers: ['Chrome', 'Firefox'],
reporters: ['mocha', 'allure'],
frameworks: ['mocha'],
allureReport: {
reportDir: '/tmp/allure_result',
useBrowserName: true
},
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-sourcemap-loader',
'karma-webpack',
'karma-mocha',
'karma-mocha-reporter',
'karma-allure-reporter',
]
}
}
};