2021-08-19 21:14:50 +02:00
|
|
|
/**
|
|
|
|
* Global config for the main Vue app. ES7 not supported here.
|
|
|
|
* See docs for all config options: https://cli.vuejs.org/config
|
|
|
|
*/
|
2021-06-23 16:34:18 +02:00
|
|
|
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
|
|
|
|
|
2021-12-21 20:46:32 +01:00
|
|
|
// Get app mode: production, development or test
|
|
|
|
const mode = process.env.NODE_ENV || 'production';
|
|
|
|
|
2021-06-22 23:28:08 +02:00
|
|
|
// Get current version
|
2021-08-20 01:36:38 +02:00
|
|
|
process.env.VUE_APP_VERSION = require('./package.json').version;
|
2021-08-19 21:14:50 +02:00
|
|
|
|
2021-09-04 21:01:25 +02:00
|
|
|
// 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 = {
|
2021-12-21 20:46:32 +01:00
|
|
|
mode,
|
2021-09-04 21:01:25 +02:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{ test: /.svg$/, loader: 'vue-svg-loader' },
|
2021-06-23 16:34:18 +02:00
|
|
|
],
|
2021-04-17 19:42:38 +02:00
|
|
|
},
|
2021-09-04 21:01:25 +02:00
|
|
|
plugins: [
|
|
|
|
new ProgressBarPlugin({ format: progressFormat }),
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
// Application pages
|
|
|
|
const pages = {
|
|
|
|
dashy: {
|
|
|
|
entry: 'src/main.js',
|
|
|
|
filename: 'index.html',
|
2021-05-31 18:01:00 +02:00
|
|
|
},
|
2021-09-04 21:01:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Export the main Vue app config
|
|
|
|
module.exports = {
|
|
|
|
publicPath,
|
|
|
|
pwa,
|
|
|
|
integrity,
|
|
|
|
configureWebpack,
|
|
|
|
pages,
|
|
|
|
chainWebpack: config => {
|
|
|
|
config.module.rules.delete('svg');
|
2021-06-20 18:01:00 +02:00
|
|
|
},
|
2021-04-17 19:42:38 +02:00
|
|
|
};
|