49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import { createRequire } from "node:module";
|
|
import path from "node:path";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import { defineConfig } from "vite";
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
|
|
const require = createRequire(import.meta.url);
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), tsconfigPaths(), tailwindcss()],
|
|
resolve: {
|
|
dedupe: ["react", "react-dom"],
|
|
alias: [
|
|
{ find: "@", replacement: path.resolve(__dirname, "./src") },
|
|
{
|
|
find: /^react$/,
|
|
replacement: require.resolve("react"),
|
|
},
|
|
{
|
|
find: /^react-dom$/,
|
|
replacement: require.resolve("react-dom"),
|
|
},
|
|
{
|
|
find: /^react-dom\/client$/,
|
|
replacement: require.resolve("react-dom/client"),
|
|
},
|
|
{
|
|
find: /^react\/jsx-runtime$/,
|
|
replacement: require.resolve("react/jsx-runtime"),
|
|
},
|
|
{
|
|
find: /^react\/jsx-dev-runtime$/,
|
|
replacement: require.resolve("react/jsx-dev-runtime"),
|
|
},
|
|
],
|
|
},
|
|
optimizeDeps: {
|
|
exclude: ["@autumn/shared", "zod/v4"],
|
|
},
|
|
server: {
|
|
host: "0.0.0.0",
|
|
port: Number.parseInt(process.env.VITE_PORT || "3001", 10),
|
|
fs: {
|
|
allow: [".."],
|
|
},
|
|
},
|
|
});
|