Frameworks
Vite and single-page apps on Stackap
Stackap builds a Vite, Create React App, Vue CLI or Parcel project in a container and serves the output from nginx, sending unknown paths to index.html so client-side routing works.
How Stackap recognizes Vite
A project counts as a single-page app when it has a build script and lists vite, react-scripts, @vue/cli-service or parcel as a dependency. Dependencies are checked before scripts on purpose: Vite and Create React App both define a start script that launches a development server, and treating them as Node apps would deploy a dev server to production. React apps are covered by this path whether they use Vite or Create React App.
What Stackap builds
The generated image has two stages. The first installs dependencies with the package manager the lockfile implies and runs your build script. The second is nginx, which serves the build output and falls back to index.html for any path that is not a file, so a route such as /settings opened directly does not return a 404.
Because the result is static files, there is no server code to run, memory use is tiny, and a build-time variable is baked into the files. Anything prefixed the way your bundler requires for public values, for example VITE_ in Vite, is visible to every visitor and must never hold a secret.
What a Vite project needs
- A
buildscript inpackage.json. - No server adapter. A Remix, Nuxt or SvelteKit project that renders on a server is a different case and is not served this way.
- A lockfile, so the install is reproducible.
- API calls to a separate backend, since a static app has no server of its own. Point it at a Stackap project that does.
Verification status
Tested with a real Docker build of the generated image for the single-page-app path, including the index.html fallback, as part of the platform's own test suite.
Still to verify: a catalogue of individual Vite versions, plugins that write their output somewhere unusual, or monorepos where the app is not at the repository root.
Early-access scope
- Static output only. Anything that needs to run code on the server is out of scope for this path.
- The fallback sends every unknown path to
index.html, so a mistyped URL returns the app's shell with a 200 status instead of a true 404. Static-site generators on the next page behave differently and return real 404s. - There is no content delivery network in front of the files, so visitors far from the server see more latency.
- Monorepo layouts are untested.
Questions
Does it work for React?
Why is a missing page not a 404?
Stackap is in early access. Tell us what you run and we will reply with a straight answer about whether it fits.
Ask for an invitationLast updated .