-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
54 lines (50 loc) · 1.13 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
// vue.config.js
module.exports = {
chainWebpack: (config) => {
const svgRule = config.module.rule('svg');
// clear all existing loaders.
// if you don't do this, the loader below will be appended to
// existing loaders of the rule.
svgRule.uses.clear();
// add replacement loader(s)
svgRule
.test(/\.(svg)$/)
.use('html-loader')
.loader('html-loader')
.options({
attrs: ['div:v-html'],
});
config.module
.rule('fonts')
.test(/\.(woff|woff2|eot|ttf)$/)
.use('url-loader')
.loader('url-loader')
.options({
name: '../assets/fonts/[name].[ext]',
});
},
configureWebpack: {
module: {
rules: [
{
test: /\.vue$/,
use: [{
loader: 'vue-svg-inline-loader',
}],
}],
},
},
css: {
loaderOptions: {
// pass options to sass-loader
css: {
sourceMap: true,
},
sass: {
// ~@/ is an alias to src/
// so this assumes you have a file named `src/style.scss`
data: '@import "~@/style/style.scss";',
},
},
},
};