yotta-node/vite.config.ts

37 lines
813 B
TypeScript
Raw Permalink Normal View History

2024-06-26 15:31:14 +08:00
/*
* @LastEditors: John
* @Date: 2024-06-17 17:20:03
2024-06-27 17:00:45 +08:00
* @LastEditTime: 2024-06-26 17:50:12
2024-06-26 15:31:14 +08:00
* @Author: John
*/
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({
server: {
host: "192.168.10.167",
proxy: {
"/dev": {
2024-06-27 17:00:45 +08:00
target: "http://192.168.10.106:8102",
2024-06-26 15:31:14 +08:00
changeOrigin: true,
rewrite: (path) => path.replace(/^\/dev/, ""),
},
},
},
plugins: [
react(),
viteCompression({ deleteOriginFile: false }),
nodePolyfills(),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
css: {},
});