36 lines
832 B
TypeScript
36 lines
832 B
TypeScript
import { fileURLToPath, URL } from "node:url";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { devtools } from "@tanstack/devtools-vite";
|
|
import { tanstackRouter } from "@tanstack/router-plugin/vite";
|
|
import viteReact from "@vitejs/plugin-react";
|
|
import { defineConfig } from "vite";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
base: "./",
|
|
plugins: [
|
|
devtools(),
|
|
tanstackRouter({
|
|
target: "react",
|
|
autoCodeSplitting: true,
|
|
}),
|
|
viteReact(),
|
|
tailwindcss(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/v1": {
|
|
target: "https://api.ppanel.dev",
|
|
changeOrigin: true,
|
|
secure: false,
|
|
rewrite: (path) => path.replace(/^\/v1/, "/v1"),
|
|
},
|
|
},
|
|
},
|
|
});
|