78 lines
1.5 KiB
TypeScript
78 lines
1.5 KiB
TypeScript
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
|
import { defineConfig } from "vite";
|
|
import tsConfigPaths from "vite-tsconfig-paths";
|
|
import viteReact from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
import { devtools } from "@tanstack/devtools-vite";
|
|
import { leanWorkerBundle } from "./vite-plugin-lean-worker-bundle";
|
|
|
|
export default defineConfig(() => {
|
|
const port = 3001;
|
|
|
|
const showDevtools = false;
|
|
|
|
const allowedHosts = [
|
|
"seo.thedomainnest.com",
|
|
];
|
|
|
|
return {
|
|
envPrefix: [
|
|
"VITE_",
|
|
"AUTH_MODE",
|
|
"BYPASS_EMAIL_VERIFICATION",
|
|
"POSTHOG_PUBLIC_KEY",
|
|
"POSTHOG_HOST",
|
|
"TURNSTILE_SITE_KEY",
|
|
],
|
|
|
|
server: {
|
|
host: "0.0.0.0",
|
|
port,
|
|
allowedHosts,
|
|
},
|
|
|
|
preview: {
|
|
host: "0.0.0.0",
|
|
port,
|
|
allowedHosts,
|
|
},
|
|
|
|
build: {
|
|
sourcemap: false,
|
|
outDir: "dist",
|
|
},
|
|
|
|
plugins: [
|
|
leanWorkerBundle(),
|
|
|
|
showDevtools
|
|
? devtools({
|
|
consolePiping: {
|
|
enabled: true,
|
|
levels: ["log", "warn", "error", "info", "debug"],
|
|
},
|
|
})
|
|
: null,
|
|
|
|
cloudflare({
|
|
inspectorPort: false,
|
|
viteEnvironment: { name: "ssr" },
|
|
auxiliaryWorkers: [
|
|
{
|
|
configPath: "./wrangler.audit.jsonc",
|
|
},
|
|
],
|
|
}),
|
|
|
|
tsConfigPaths(),
|
|
|
|
tanstackStart(),
|
|
|
|
viteReact(),
|
|
|
|
tailwindcss(),
|
|
],
|
|
};
|
|
});
|