vue.config.js
1.17 KB
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
/*
* @Description:
* @Author: huyue
* @Date: 2023-01-16 17:23:14
* @LastEditors: huyue
* @LastEditTime: 2023-06-06 15:07:11
*/
const { defineConfig } = require("@vue/cli-service");
const AutoImport = require("unplugin-auto-import/webpack");
const Components = require("unplugin-vue-components/webpack");
const { ElementPlusResolver } = require("unplugin-vue-components/resolvers");
const path = require("path");
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
plugins: [
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
],
},
devServer: {
// https: {
// key: path.join(__dirname, "/src/config/https/cert.key"),
// cert: path.join(__dirname, "/src/config/https/cert.crt"),
// },
proxy: {
"/api": {
target: "http://192.168.1.68:7003",
ws: true,
changeOrigin: true,
pathRewrite: { "^/api": "" },
bypass: function (req, res, proxyOptions) {
if (req.headers.accept.indexOf("html") !== -1) {
return "/index.html";
}
},
},
},
},
});