2025-11-04 15:47:17 +00:00
|
|
|
import path from "node:path";
|
2026-07-05 11:43:13 +00:00
|
|
|
|
2025-05-10 08:40:40 +00:00
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
2025-05-27 17:47:03 +00:00
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
import { defineConfig } from "vite";
|
2025-05-02 21:43:51 +00:00
|
|
|
|
2026-08-20 08:41:56 +00:00
|
|
|
const appNodeModulesPath = path.resolve(__dirname, "./node_modules");
|
|
|
|
|
const hmrHost = process.env.VITE_HMR_HOST;
|
|
|
|
|
const hmrClientPort = process.env.VITE_HMR_CLIENT_PORT
|
|
|
|
|
? Number(process.env.VITE_HMR_CLIENT_PORT)
|
|
|
|
|
: undefined;
|
|
|
|
|
const hmrProtocol = process.env.VITE_HMR_PROTOCOL;
|
|
|
|
|
|
2025-05-05 09:27:00 +00:00
|
|
|
// https://vite.dev/config/
|
2025-05-02 21:43:51 +00:00
|
|
|
export default defineConfig({
|
2025-09-22 08:13:59 +00:00
|
|
|
build: {
|
2026-07-05 11:43:13 +00:00
|
|
|
sourcemap: true,
|
2026-04-12 10:07:15 +00:00
|
|
|
},
|
|
|
|
|
define: {
|
2026-07-05 11:43:13 +00:00
|
|
|
"process.env": {},
|
2025-09-22 08:13:59 +00:00
|
|
|
},
|
2025-05-28 14:21:09 +00:00
|
|
|
plugins: [react(), tailwindcss()],
|
2026-08-20 08:41:56 +00:00
|
|
|
server: {
|
|
|
|
|
host: true,
|
|
|
|
|
hmr:
|
|
|
|
|
hmrHost || hmrClientPort || hmrProtocol
|
|
|
|
|
? {
|
|
|
|
|
host: hmrHost,
|
|
|
|
|
clientPort: hmrClientPort,
|
|
|
|
|
protocol: hmrProtocol,
|
|
|
|
|
}
|
|
|
|
|
: undefined,
|
|
|
|
|
},
|
2025-05-09 10:45:32 +00:00
|
|
|
resolve: {
|
2026-08-20 08:41:56 +00:00
|
|
|
dedupe: ["react", "react-dom", "react/jsx-runtime", "react/jsx-dev-runtime"],
|
2025-05-09 10:45:32 +00:00
|
|
|
alias: {
|
|
|
|
|
"@": path.resolve(__dirname, "./src"),
|
2026-08-20 08:41:56 +00:00
|
|
|
react: path.resolve(appNodeModulesPath, "react"),
|
|
|
|
|
"react-dom": path.resolve(appNodeModulesPath, "react-dom"),
|
|
|
|
|
"react-dom/client": path.resolve(appNodeModulesPath, "react-dom/client.js"),
|
|
|
|
|
"react/jsx-runtime": path.resolve(appNodeModulesPath, "react/jsx-runtime.js"),
|
|
|
|
|
"react/jsx-dev-runtime": path.resolve(appNodeModulesPath, "react/jsx-dev-runtime.js"),
|
2025-05-09 10:45:32 +00:00
|
|
|
},
|
|
|
|
|
},
|
2025-05-02 21:43:51 +00:00
|
|
|
});
|