-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
39 lines (37 loc) · 993 Bytes
/
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
const path = require('path')
function addStyleResource (rule) {
rule.use('style-resource')
.loader('style-resources-loader')
.options({
patterns: [
path.resolve(__dirname, './src/assets/styles/global/_variable.scss'),
],
})
}
module.exports = {
publicPath: './',
// devServer: {
// proxy: {
// '/api': {
// target: 'http://114.67.66.81:8081',
// changeOrigin: true
// }
// }
// },
productionSourceMap: false,
chainWebpack: config => {
// 处理svg vue-svg-loader也可以
const svgRule = config.module.rule("svg");
svgRule.uses.clear();
svgRule
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({
symbolId: "icon-[name]",
include: ["./src/assets/icons"]
});
// 自动化导入
const types = ['vue-modules', 'vue', 'normal-modules', 'normal'];
types.forEach(type => addStyleResource(config.module.rule('scss').oneOf(type)));
}
}