You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(platform): gate SSR renderer + add Nitro externals/sanitizer for non-SSR and edge cases
Three small additions to analogNitroPlugin found while migrating the
other demo apps:
1. Gate the analog-owned SSR renderer registration behind options.ssr.
When ssr is false, leave Nitro's auto-detected template-serving
renderer in place — serving the raw index.html for every HTML
request is exactly the desired behavior, and our renderer virtual
would otherwise try to dispatch to an SSR service that was never
built. Lets tailwind-debug-app (ssr: false) build cleanly.
2. Carry over Analog's Nitro externals list. rxjs's facade subpaths
confuse Nitro/Rolldown's resolver, node-fetch-native's polyfill
rewrites global fetch, and sharp ships platform-specific binaries
under @img/sharp-* whose unused symlinks crash Nitro's externals
plugin with ENOENT during realpath(). All three were externalized
by the legacy @analogjs/vite-plugin-nitro orchestrator; they need
to be restored under the new plugin chain or blog-app's nitro env
build fails on the sharp symlink walk.
3. Carry over the Nitro/Rolldown bundler-config sanitizer. Nitro's
Rollup config sets output.codeSplitting (rejected as unknown by
Rolldown), output.manualChunks (crashes Nitro's prerender
rebundle), and a chunkFileNames function that emits route-derived
[token] patterns Rollup/Rolldown treats as placeholders. The
sanitizer strips the first two and rewrites non-standard [token]
patterns to _token_.
All three apply in the rollup:before hook on the resolved Nitro
bundler config so they survive into both the main bundle and the
prerender bundle.
Refs #2035
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments