forked from ThingsPanel/thingspanel-frontend-community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
77 lines (74 loc) · 2.35 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// const path = require("path");
const CompressionPlugin = require("compression-webpack-plugin");
module.exports = {
// publicPath: "",
productionSourceMap: false, // 生产打包时不输出map文件
// runtimeCompiler: true,
devServer: {
port: 8080,
host: 'localhost',
open: true,
overlay: {
warnings: false,
errors: true,
},
proxy: {
"/api": {
target: process.env.VUE_APP_BASE_URL + "/api",
changeOrigin: true, // 是否改变域名
pathRewrite: {
// 路径重写
"/api": "" // 这个意思就是以api开头的,定向到哪里, 如果你的后边还有路径的话, 会自动拼接上
}
},
"/red": {
target: process.env.VUE_APP_RED_BASE_URL,
changeOrigin: true, // 是否改变域名
pathRewrite: {
// 路径重写
"/red": ""
}
},
"/store": {
target: process.env.VUE_APP_STORE_BASE_URL,
changeOrigin: true, // 是否改变域名
pathRewrite: {
"^/store": ""
}
}
}
},
lintOnSave: false,
configureWebpack: {
resolve: {
alias: {
// If using the runtime only build
// vue$: "vue/dist/vue.runtime.esm.js" // 'vue/dist/vue.runtime.common.js' for webpack 1
// Or if using full build of Vue (runtime + compiler)
// vue$: 'vue/dist/vue.esm.js' // 'vue/dist/vue.common.js' for webpack 1
}
},
plugins: [
new CompressionPlugin({
filename: '[path][base].gz',
algorithm: 'gzip',
test: /\.js$|\.css$|\.html$/,
threshold: 10240,
minRatio: 0.8
}),
]
},
css: {
loaderOptions: {
postcss: {
config: {
path: __dirname
}
},
scss: {
prependData: `@import "@/assets/sass/vendors/vue/vuetify/variables.scss";`
}
}
},
transpileDependencies: ["vuetify"]
};