-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
40 lines (37 loc) · 962 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
40
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
publicPath: "./",
devServer: {
// can be overwritten by process.env.HOST
host: "0.0.0.0",
port: 8090
},
//生产环境是否生成 sourceMap 文件,一般情况不建议打开
productionSourceMap: false,
css: {
loaderOptions: {
sass: {
data: `@import "~@/assets/scss/base.scss";`
}
}
},
chainWebpack: config => {
config.resolve.alias
.set("@", resolve("src"))
.set("src", resolve("src"))
.set("common", resolve("src/common"))
.set("components", resolve("src/components"));
["vue-modules", "vue", "normal-modules", "normal"].forEach(match => {
config.module
.rule("sass")
.oneOf(match)
.use("sass-loader")
.tap(opt =>
Object.assign(opt, { data: `@import '~@/assets/scss/base.scss'` })
);
});
}
};