2024-06-19 18:35:06 +08:00
|
|
|
/*
|
|
|
|
* @LastEditors: John
|
|
|
|
* @Date: 2024-06-17 17:20:03
|
2024-06-24 11:15:18 +08:00
|
|
|
* @LastEditTime: 2024-06-24 10:08:56
|
2024-06-19 18:35:06 +08:00
|
|
|
* @Author: John
|
|
|
|
*/
|
2024-06-18 10:56:57 +08:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
import path from "path";
|
|
|
|
import viteCompression from "vite-plugin-compression";
|
|
|
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2024-06-19 18:35:06 +08:00
|
|
|
server: {
|
|
|
|
host: "192.168.10.167",
|
2024-06-24 11:15:18 +08:00
|
|
|
proxy: {
|
|
|
|
"/dev": {
|
|
|
|
target: "http://192.168.10.106:8100",
|
|
|
|
changeOrigin: true,
|
|
|
|
rewrite: (path) => path.replace(/^\/dev/, ""),
|
|
|
|
},
|
|
|
|
},
|
2024-06-19 18:35:06 +08:00
|
|
|
},
|
2024-06-18 10:56:57 +08:00
|
|
|
plugins: [
|
|
|
|
react(),
|
|
|
|
viteCompression({ deleteOriginFile: false }),
|
|
|
|
nodePolyfills(),
|
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"@": path.resolve(__dirname, "./src"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
css: {},
|
|
|
|
});
|