desvincula o app do Lovable e corrige preset de build para Node
Remove .lovable/, AGENTS.md (banner de sync), bun.lock/bunfig.toml (não usados, o build é via npm), lovable-error-reporting.ts, a dependência @lovable.dev/vite-tanstack-config e o branding Lovable nas metatags. vite.config.ts passa a configurar os plugins do TanStack Start/Tailwind/nitro diretamente, sem o wrapper deles. Nisso, corrige um bug crítico: o preset do nitro estava em cloudflare-module (gera um Cloudflare Worker), mas o Dockerfile roda o build direto com `node`. O container subiria sem escutar em porta nenhuma e o /healthz falharia sempre. Preset trocado para node-server.
This commit is contained in:
+38
-13
@@ -1,15 +1,40 @@
|
||||
// @lovable.dev/vite-tanstack-config already includes the following — do NOT add them manually
|
||||
// or the app will break with duplicate plugins:
|
||||
// - TanStack devtools (dev-only, first), tanstackStart, viteReact, tailwindcss, tsConfigPaths,
|
||||
// nitro (build-only using cloudflare as a default target), VITE_* env injection, @ path alias,
|
||||
// React/TanStack dedupe, error logger plugins, and sandbox detection (port/host/strictPort).
|
||||
// You can pass additional config via defineConfig({ vite: { ... }, etc... }) if needed.
|
||||
import { defineConfig } from "@lovable.dev/vite-tanstack-config";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { defineConfig } from "vite";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import tsConfigPaths from "vite-tsconfig-paths";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
||||
import { nitro } from "nitro/vite";
|
||||
|
||||
export default defineConfig({
|
||||
tanstackStart: {
|
||||
// Redirect TanStack Start's bundled server entry to src/server.ts (our SSR error wrapper).
|
||||
// nitro/vite builds from this
|
||||
server: { entry: "server" },
|
||||
export default defineConfig(({ command }) => ({
|
||||
css: { transformer: "lightningcss" },
|
||||
resolve: {
|
||||
alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
|
||||
dedupe: [
|
||||
"react",
|
||||
"react-dom",
|
||||
"react/jsx-runtime",
|
||||
"react/jsx-dev-runtime",
|
||||
"@tanstack/react-query",
|
||||
"@tanstack/query-core",
|
||||
],
|
||||
},
|
||||
});
|
||||
optimizeDeps: {
|
||||
include: ["react", "react-dom", "react-dom/client", "react/jsx-runtime", "react/jsx-dev-runtime"],
|
||||
},
|
||||
server: {
|
||||
host: "::",
|
||||
port: 8080,
|
||||
},
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
tsConfigPaths({ projects: ["./tsconfig.json"] }),
|
||||
tanstackStart({
|
||||
server: { entry: "server" },
|
||||
}),
|
||||
// Node HTTP server output, not a Cloudflare Worker: the Dockerfile runs
|
||||
// this with plain `node`, so the build must target node-server.
|
||||
...(command === "build" ? [nitro({ preset: "node-server" })] : []),
|
||||
react(),
|
||||
],
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user