-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPA provider (vite) #1257
base: main
Are you sure you want to change the base?
SPA provider (vite) #1257
Conversation
no idea why the lunatic one is failing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! This will definitely make it easier for people coming from Vite apps.
Do you know how this will interact with users who have a custom nixpacks.toml and Caddy file for deploying static sites already?
I'm not sure, but the Caddyfile wouldn't overwrite the users. And im pretty sure it would just use what's in nixpacks.toml as opposed to what the SPA provider generates. |
…packs into milo/spa-provider
This PR introduces a Vite SPA provider which will automatically run supported applications with Caddy.
It can be configured via NIXPACKS_SPA_CADDY to turn off Caddy, or if you want to turn Caddy on for an application that doesn't automatically get detected, you can specify a build directory with the NIXPACKS_SPA_OUT_DIR variable.
Detection
Vite is detected by:
vite
dependencyvite.config.js
orvite.config.ts
vite build
Output directory:
outDir
is invite.config.js/ts
--outDir
is in the build scriptCaddy:
react
vue
svelte
(but not@sveltejs/kit
)preact
lit
solid-js
@builder.io/qwik