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
|
|
|
|
2024-04-01 15:38:04 +03:00
|
|
|
const path = require('path');
|
|
|
|
|
2021-12-21 22:46:32 +03:00
|
|
|
// Get app mode: production, development or test
|
|
|
|
const mode = process.env.NODE_ENV || 'production';
|
|
|
|
|
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';
|
|
|
|
|
|
|
|
// Webpack Config
|
|
|
|
const configureWebpack = {
|
2021-12-21 22:46:32 +03:00
|
|
|
mode,
|
2021-09-04 22:01:25 +03:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2024-04-01 15:38:04 +03:00
|
|
|
// Development server config
|
|
|
|
const devServer = {
|
|
|
|
contentBase: [
|
|
|
|
path.join(__dirname, 'public'),
|
|
|
|
path.join(__dirname, 'user-data'),
|
|
|
|
],
|
|
|
|
watchContentBase: true,
|
|
|
|
publicPath: '/',
|
|
|
|
};
|
|
|
|
|
2021-09-04 22:01:25 +03:00
|
|
|
// 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,
|
2024-04-01 15:38:04 +03:00
|
|
|
devServer,
|
2021-09-04 22:01:25 +03:00
|
|
|
chainWebpack: config => {
|
|
|
|
config.module.rules.delete('svg');
|
2021-06-20 19:01:00 +03:00
|
|
|
},
|
2021-04-17 20:42:38 +03:00
|
|
|
};
|