-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
35 lines (33 loc) · 933 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
const path = require("path");
module.exports = {
publicPath: process.env.NODE_ENV === "production" ? "/mj-ui/dist/" : "/",
chainWebpack: config => {
config.resolve.alias.set("~", path.resolve("packages"));
const types = ["vue-modules", "vue", "normal-modules", "normal"];
types.forEach(type =>
addStyleResource(config.module.rule("scss").oneOf(type))
);
},
devServer: {
before: function(app) {
app.get("*.vue", function(req, res) {
res.sendFile(path.join(__dirname, req.path), {
headers: {
"Content-Type": "text/html;charset=utf-8"
}
});
});
}
}
};
function addStyleResource(rule) {
rule
.use("style-resource")
.loader("style-resources-loader")
.options({
patterns: [
path.resolve(__dirname, "src/assets/theme/base.scss"),
path.resolve(__dirname, "src/assets/theme/page.scss")
]
});
}