forked from Lissy93/dashy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
57 lines (48 loc) · 1.33 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
/**
* Global config for the main Vue app. ES7 not supported here.
* See docs for all config options: https://cli.vuejs.org/config
*/
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
// Get app mode: production, development or test
const mode = process.env.NODE_ENV || 'production';
// Get current version
process.env.VUE_APP_VERSION = require('./package.json').version;
// Get default info for PWA
const { pwa } = require('./src/utils/defaults');
// Get base URL
const publicPath = process.env.BASE_URL || '/';
// Should enable Subresource Integrity (SRI) on link and script tags
const integrity = process.env.INTEGRITY === 'true';
// Format for progress bar, shown while app building
const progressFormat = '\x1b[1m\x1b[36mBuilding Dashy\x1b[0m '
+ '[\x1b[1m\x1b[32m:bar\x1b[0m] :percent (:elapsed seconds)';
// Webpack Config
const configureWebpack = {
mode,
module: {
rules: [
{ test: /.svg$/, loader: 'vue-svg-loader' },
],
},
plugins: [
new ProgressBarPlugin({ format: progressFormat }),
],
};
// Application pages
const pages = {
dashy: {
entry: 'src/main.js',
filename: 'index.html',
},
};
// Export the main Vue app config
module.exports = {
publicPath,
pwa,
integrity,
configureWebpack,
pages,
chainWebpack: config => {
config.module.rules.delete('svg');
},
};