forked from RunOnFlux/flux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
107 lines (103 loc) · 3.03 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
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
// const CompressionPlugin = require('compression-webpack-plugin');
// ideally https://github.com/webpack-contrib/compression-webpack-plugin#using-brotli from nodejs 11.7.0
// const BrotliPlugin = require('brotli-webpack-plugin');
// const zopfli = require('@gfx/zopfli');
// const productionGzipExtensions = ['js', 'css'];
const plugins = [
new CopyPlugin({
patterns: [
{ from: path.resolve(__dirname, 'HomeUI', 'public') },
],
}),
];
// if (process.env.NODE_ENV === 'production') {
// const compressionTest = /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i;
// plugins = [
// new CompressionPlugin({
// algorithm(input, compressionOptions, callback) {
// return zopfli.gzip(input, compressionOptions, callback);
// },
// compressionOptions: {
// numiterations: 15,
// },
// minRatio: 0.99,
// test: compressionTest,
// }),
// new BrotliPlugin({
// test: compressionTest,
// minRatio: 0.99,
// }),
// ];
// }
module.exports = {
css: {
loaderOptions: {
sass: {
sassOptions: {
includePaths: ['./node_modules', './HomeUI/src/assets'],
},
},
},
},
configureWebpack: {
resolve: {
alias: {
'@': path.resolve(__dirname, './HomeUI/src/'),
'@themeConfig': path.resolve(__dirname, './HomeUI/themeConfig.js'),
'@core': path.resolve(__dirname, './HomeUI/src/@core'),
'@validations': path.resolve(__dirname, './HomeUI/src/@core/utils/validations/validations.js'),
'@axios': path.resolve(__dirname, './HomeUI/src/libs/axios'),
ZelBack: path.resolve(__dirname, './ZelBack'),
Config: path.resolve(__dirname, './config'),
},
},
plugins,
externals(context, request, callback) {
if (/xlsx|canvg|pdfmake/.test(request)) {
return callback(null, `commonjs ${request}`);
}
return callback();
},
watchOptions: {
ignored: /node_modules/,
},
},
chainWebpack: (config) => {
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap((options) => {
// eslint-disable-next-line no-param-reassign
options.transformAssetUrls = {
img: 'src',
image: 'xlink:href',
'b-avatar': 'src',
'b-img': 'src',
'b-img-lazy': ['src', 'blank-src'],
'b-card': 'img-src',
'b-card-img': 'src',
'b-card-img-lazy': ['src', 'blank-src'],
'b-carousel-slide': 'img-src',
'b-embed': 'src',
};
return options;
});
},
transpileDependencies: ['resize-detector'],
outputDir: path.join(__dirname, './HomeUI/dist'),
pages: {
index: {
// entry for the page
entry: 'HomeUI/src/main.js',
// the source template
template: 'HomeUI/public/index.html',
// output as dist/index.html
filename: 'index.html',
},
},
filenameHashing: false,
productionSourceMap: false,
};