2021-08-19 22:14:50 +03: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 17:34:18 +03:00
|
|
|
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
|
|
|
|
|
2021-06-23 00:28:08 +03:00
|
|
|
// Get current version
|
2021-08-20 02:36:38 +03:00
|
|
|
process.env.VUE_APP_VERSION = require('./package.json').version;
|
2021-08-19 22:14:50 +03:00
|
|
|
|
2021-09-04 22:01:25 +03: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 = {
|
|
|
|
performance: { hints: false },
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{ test: /.svg$/, loader: 'vue-svg-loader' },
|
2021-06-23 17:34:18 +03:00
|
|
|
],
|
2021-04-17 20:42:38 +03:00
|
|
|
},
|
2021-09-04 22:01:25 +03:00
|
|
|
plugins: [
|
|
|
|
new ProgressBarPlugin({ format: progressFormat }),
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
// Application pages
|
|
|
|
const pages = {
|
|
|
|
dashy: {
|
|
|
|
entry: 'src/main.js',
|
|
|
|
filename: 'index.html',
|
2021-05-31 19:01:00 +03:00
|
|
|
},
|
2021-09-04 22:01:25 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
// Export the main Vue app config
|
|
|
|
module.exports = {
|
|
|
|
publicPath,
|
|
|
|
pwa,
|
|
|
|
integrity,
|
|
|
|
configureWebpack,
|
|
|
|
pages,
|
|
|
|
chainWebpack: config => {
|
|
|
|
config.module.rules.delete('svg');
|
2021-06-20 19:01:00 +03:00
|
|
|
},
|
2021-04-17 20:42:38 +03:00
|
|
|
};
|