forked from stonerao/w3d-edit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
36 lines (35 loc) · 1.33 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
module.exports = {
lintOnSave: false,
publicPath: "./", // 公共路径(必须有的)
outputDir: "dist", // 输出文件目录
assetsDir: "static", //静态资源文件名称
productionSourceMap: false, //去除打包后js的map文件
//去掉console
configureWebpack: (config) => {
// 判断为生产模式下,因为开发模式我们是想保存console的
if (process.env.NODE_ENV === "production") {
config.optimization.minimizer.map((arg) => {
const option = arg.options.terserOptions.compress;
option.drop_console = true; // 打开开关
return arg;
});
}
},
devServer: {
open: true, // 自动打开浏览器
host: '0.0.0.0', // 真机模拟,使用
port: '8080', // 前台代理端口号
https: false, // https: {type: Booleam}
hotOnly: false, // 热更新
proxy: {
'/model': {
target: 'http://10.0.3.39:8081/', // 要访问的跨域的域名
ws: true, // 如果要代理websockets
changeOrigin: true, // 开启代理
pathRewrite: { // 路径重写
'^/model': '' // 使用 `/api` 代替 `target` 要访问的跨域的域名
}
}
}
}
}