Deploy/Adapters/Netlify/Deploying to Netlify
@sigx/netlify · Stable

Deploying to Netlify#

The build emits a v2 function through Netlify's Frameworks API with the routing policy made declarative: the CDN serves files first, the catch-all function renders everything else, and your netlify.toml stays yours.

The generated layout#

.netlify/v1/functions/sigx-ssr/
├── sigx-ssr.mjs        # the v2 function: bare default fetch fn + in-source config
├── <bundled entry>.js  # your entry, fully self-contained (+ any chunks)
└── package.json        # {"type":"module"}

The Frameworks API is Netlify's recommended channel for build-tool adapters. The generated in-source config is the routing policy made declarative:

  • path: '/*' — the catch-all,
  • preferStatic: true — CDN files win before the function runs,
  • nodeBundler: 'none' — the output is final; Netlify ships the directory as-is.

Two details are load-bearing:

  • index.html is removed from the publish dir after the build — it is the raw outlet template, and preferStatic would serve it for /, shadowing the document render. (The template is already inlined into the bundle via virtual:sigx-app.)
  • netlify.toml is printed, never written — the config is yours from its first character.

The platform entry — yours, scaffolded once#

The first build scaffolds src/entry.netlify.ts iff absent and never touches it again. It keeps the same export default { fetch } shape as every sigx platform entry — the Netlify-specific contract (bare default function + export const config) lives in the generated wrapper, so your composition stays portable:

static assets  →  server functions  →  document render

Deploy#

Terminal
vite build --app -c vite.config.netlify.ts
netlify deploy --prod             # builds by default
netlify deploy --prod --no-build  # ship the prebuilt output as-is

Verification posture#

Structural, not emulation: CI asserts the generated layout and invokes the function's default export directly under Node with real Requests (a pure fetch handler — the context argument is optional sugar it never touches). Reference wiring: examples/resume in the SignalX core repo (vite.config.netlify.ts, committed entry.netlify.ts, netlify.toml).