0512428601
adapter-auto doesn't produce a runnable standalone server when it can't detect a supported hosting platform (Vercel/Netlify/Cloudflare/etc.) — this is a self-hosted app with no such platform, so builds were silently missing a real server output. Swapped to adapter-node, which builds to build/index.js: a persistent Node server that reads PORT/HOST/ORIGIN at runtime, exactly what a reverse proxy needs to point a domain at. Added a README section covering the full path: building/running both apps as plain Node processes, the env vars each needs, and the Nginx Proxy Manager side (proxy host + Custom Locations for /api and /media under a single-domain, path-routed setup, or a simpler two-domain alternative). Verified live: the adapter-node build actually serves pages and correctly picks up ADMIN_PANEL_ENABLED via `node --env-file=.env build/index.js` (SvelteKit's $env/dynamic/private reads process.env directly in production, unlike the vite-dev-time gap from the previous fix).
23 lines
867 B
TypeScript
23 lines
867 B
TypeScript
import adapter from '@sveltejs/adapter-node';
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
sveltekit({
|
|
compilerOptions: {
|
|
// Force runes mode for the project, except for libraries. Can be removed in svelte 6.
|
|
runes: ({ filename }) =>
|
|
filename.split(/[/\\]/).includes('node_modules') ? undefined : true
|
|
},
|
|
|
|
// adapter-node — this is a self-hosted app (see the "self-hosted" masthead tag),
|
|
// meant to run as a standalone Node server behind a reverse proxy (e.g. Nginx
|
|
// Proxy Manager) rather than on a specific platform like Vercel/Netlify/Cloudflare,
|
|
// which is what adapter-auto is for. See frontend/README.md "Deploying behind a
|
|
// reverse proxy" for the env vars (ORIGIN, PORT, etc.) this needs at runtime.
|
|
adapter: adapter()
|
|
})
|
|
]
|
|
});
|