32 lines
748 B
JavaScript
32 lines
748 B
JavaScript
|
|
import react from "@vitejs/plugin-react";
|
||
|
|
import { fileURLToPath, URL } from "node:url";
|
||
|
|
import { defineConfig } from "vite";
|
||
|
|
import { compression } from "vite-plugin-compression2";
|
||
|
|
export default defineConfig({
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
"@": fileURLToPath(new URL("./src", import.meta.url))
|
||
|
|
}
|
||
|
|
},
|
||
|
|
plugins: [
|
||
|
|
react(),
|
||
|
|
compression({
|
||
|
|
algorithms: ["gzip"],
|
||
|
|
include: /\.(js|mjs|json|css|html|svg)$/i
|
||
|
|
})
|
||
|
|
],
|
||
|
|
server: {
|
||
|
|
port: 5173,
|
||
|
|
proxy: {
|
||
|
|
"/api": {
|
||
|
|
target: "http://localhost:8888",
|
||
|
|
changeOrigin: true,
|
||
|
|
ws: true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
build: {
|
||
|
|
sourcemap: true
|
||
|
|
}
|
||
|
|
});
|