-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
54 lines (53 loc) · 1.52 KB
/
vite.config.ts
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
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import { fileURLToPath, URL } from "node:url";
import colors from "picocolors";
import { LoggerWarnOptions } from "sass";
import AutoImport from "unplugin-auto-import/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
import Components from "unplugin-vue-components/vite";
import { defineConfig } from "vite";
import { mars3dPlugin } from "vite-plugin-mars3d";
import svgLoader from "vite-svg-loader";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
vueJsx(),
svgLoader(),
mars3dPlugin(),
AutoImport({ resolvers: [ElementPlusResolver({ importStyle: "sass" })] }),
Components({ resolvers: [ElementPlusResolver({ importStyle: "sass" })] }),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler",
logger: {
warn: (message: string, options: LoggerWarnOptions) => {
if (options.deprecation) return;
console.warn("?" + colors.yellow(`[scss]: ${message}`));
},
},
},
},
},
server: {
port: 8000,
host: true,
proxy: {
"/api": {
target: "http://192.168.50.103:7878",
changeOrigin: true,
ws: true,
// rewrite: (path) => path.replace(/^\/dev/, ""),
secure: false, // 如果是https接口,需要配置这个参数
},
},
},
});