-
Notifications
You must be signed in to change notification settings - Fork 310
SPA provider (vite) #1257
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
Conversation
|
no idea why the lunatic one is failing |
coffee-cup
left a comment
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
coffee-cup
left a comment
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.
Looks good! I've tested on various repos and it works well 🎉
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:
vitedependencyvite.config.jsorvite.config.tsvite buildOutput directory:
outDiris invite.config.js/ts--outDiris in the build scriptCaddy:
reactvuesvelte(but not@sveltejs/kit)preactlitsolid-js@builder.io/qwik