-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
41 lines (39 loc) · 1.15 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
const mockData = require("./mock/search.json");
const path = require('path');
module.exports = {
publicPath: '/', // 公共路径
outputDir: process.env.NODE_ENV === "development" ? 'devdist' : 'dist', // 不同的环境打不同包名
css: { // 一次配置,全局使用,这个scss 因为每个文件都要引入
loaderOptions: {
sass: {
// data: `@import "./src/assets/hotcss/px2rem.scss";`
}
}
},
lintOnSave: false, // 关闭eslint
productionSourceMap: true, // 生产环境下css 分离文件
devServer: { // 配置服务器
port: 8080,
open: true,
https: false,
overlay: {
warnings: true,
errors: true
},
before(app) {
app.get("/api/search", (req, res) => {
res.json(mockData);
});
}
},
configureWebpack: { // 覆盖webpack默认配置的都在这里
resolve: { // 配置解析别名
alias: {
'@': path.resolve(__dirname, './src'),
// '@h': path.resolve(__dirname, './src/assets/hotcss'),
// '@s': path.resolve(__dirname, './src/assets/style'),
// '@i': path.resolve(__dirname, './src/assets/images'),
}
}
}
}