-
Notifications
You must be signed in to change notification settings - Fork 2
/
vue.config.js
94 lines (77 loc) · 2.25 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
const appConfig = require('./app.config.js');
const path = require('path');
const svgFilePath = path.join(__dirname, './src/assets/svg');
console.log('--- app config ---');
console.log(appConfig);
module.exports = {
// lintOnSave: false,
publicPath: '',
outputDir: appConfig.build.outputDir,
transpileDependencies: ['techpay-ledgerjs'],
devServer: {
https: false,
},
css: {
loaderOptions: {
scss: {
prependData: appConfig.scssData,
},
},
},
pwa: {
name: appConfig.pwa.name,
themeColor: '#1969ff',
msTileColor: '#1969ff',
assetsVersion: '4',
manifestOptions: {
background_color: '#1969ff',
categories: appConfig.pwa.categories,
},
workboxOptions: {
skipWaiting: true,
},
},
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'locales',
enableInSFC: false,
},
},
chainWebpack: (config) => {
// sets page title
config.plugin('html').tap((_args) => {
_args[0].title = appConfig.name;
_args[0].description = appConfig.description;
_args[0].keywords = appConfig.keywords;
delete _args[0].minify;
return _args;
});
config.module
.rule('vue-svgicon')
.test(/\.svg$/)
.use('svgicon')
.loader('@yzfe/vue-svgicon-loader')
.options({
idSeparator: '_',
svgFilePath,
});
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap((options) => {
options.transformAssetUrls = options.transformAssetUrls || {};
options.transformAssetUrls['icon'] = ['data'];
return options;
});
config.module.rule('svg').exclude.add(svgFilePath);
config.resolve.alias.set('@icon', svgFilePath);
config.resolve.symlinks(false);
if (!appConfig.usePWA) {
config.plugins.delete('pwa');
config.plugins.delete('workbox');
}
},
};