-
Notifications
You must be signed in to change notification settings - Fork 1
/
vue.config.js
44 lines (39 loc) · 1.19 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
const path = require('path');
const DirectoryNamedWebpackPlugin = require('directory-named-webpack-plugin');
module.exports = {
devServer: {
open: true,
},
chainWebpack: (config) => {
config.resolve.alias
.set('@', path.join(__dirname, 'src'));
// auto resolve directory imports
config.resolve
.plugin('directory-named-webpack-plugin')
.use(DirectoryNamedWebpackPlugin)
.init((Plugin) => new Plugin({ exclude: /node_modules/ }));
// when file not specified try to load vue files 1st
config.resolve.extensions.prepend('.vue');
const svgRule = config.module.rule('svg');
svgRule.uses.clear();
svgRule
.use('vue-loader')
.loader('vue-loader-v16') // `vue-loader-v16` for preview support of Vue 3 in Vue CLI
.end()
.use('vue-svg-loader')
.loader('vue-svg-loader')
.options({
svgo: {
plugins: [
'removeTitle',
'removeDesc',
'removeComments',
'removeDoctype',
{ removeViewBox: false },
{ cleanupIDs: false },
// { collapseGroups: false }, // needed for map svg CSS targeting
],
},
});
},
};