-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
50 lines (49 loc) · 1.16 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
const path = require("path");
const multer = require("multer");
const upload = multer({ dest: "upload/" });
function resolve(dir) {
return path.resolve(__dirname, dir);
}
// vue.config.js
module.exports = {
// 选项...
pages: {
index: {
entry: "src/main.js",
title: "mo-ui"
}
},
outputDir: "docs",
publicPath: "./",
devServer: {
//index: "falsy",
setup: app => {
app.post("/cgi-bin/**", upload.single("file"), function(req, res) {
console.log("req.body========", req.body);
console.log("req.file========", req.file);
setTimeout(() => {
res.send({ status: "success" });
}, 1000);
});
},
after: function() {
console.log("######################## after");
}
},
css: {
loaderOptions: {
scss: {
// eslint-disable-next-line prettier/prettier
prependData: `@import "src/scss/varibles.scss";`
}
},
extract: {
filename: "css/[name]_[chunkhash:8].css",
chunkFilename: "css/[name]_[chunkhash:8].css"
}
},
filenameHashing: false,
chainWebpack: config => {
config.resolve.alias.set("@", resolve("src"));
}
};