JavaScript apps that compile to files

Static site hosting for javascript apps is for frontends that produce a dist or build folder—React/Vite, Vue, Svelte, Astro in static mode, Next export, and similar—when you are willing to treat the host as a file server. You run the bundler locally or in CI. StaticHost stores and serves the output over HTTPS. It does not run npm for you. It does not run Hugo. It does not include email, a built-in CDN product, or forever-free hosting after a short trial. Plans: Starter $9, Pro $30, Scale $65, Business $130.

Critical constraint: nginx try_files $uri $uri/ =404 means no SPA index.html fallback. History-mode client routers that expect the server to rewrite unknown paths to index.html will 404 on refresh and deep link. Pre-render, use hash routing, or choose a platform that sells SPA rewrites.

Who this is for

  • Teams whose CI already knows npm run build.
  • Marketing sites built with JS frameworks but emitted as HTML files.
  • Demo frontends that talk to APIs hosted elsewhere.
  • Freelancers delivering static exports to clients.

Not for: apps that need server components at request time on this host, WordPress, or mailbox hosting.

Publish path for bundled frontends

  1. Set production API endpoints and public env vars at build time.
  2. Run the build on a laptop or in GitHub Actions.
  3. Upload only the output directory—never node_modules.
  4. Open HTTPS preview; test deep links explicitly.
  5. Attach the domain; configure DNS; wait for verification; wait for certificate.
  6. Roll back if a bad bundle ships; fix forward with a new artifact.

Also read: affordable static hosting, HTML hosting service, and hosting CSS/HTML sites.

Worked example: a freelance designer portfolio in Vite

A freelance designer uses Vite + vanilla JS for a portfolio with soft page transitions. They configure the build to emit multipage HTML (or accept hash routing for project filters). Locally npm run build writes dist/. They zip dist contents, upload to StaticHost on Starter ($9), and open HTTPS preview.

A deep link to /work/acme 404s because they left Vue-style history mode on without pre-rendered files. They switch project filters to hash routes (/#/work/acme)—the server only sees /—redeploy, and the padlock stays happy. Then DNS for studio.example, verification, certificate. Forms go to a SaaS endpoint. Mail is elsewhere. No remote npm on StaticHost. When they add a client microsite, Pro ($30) gives another slot plus staging.

Failure to avoid: zipping the parent folder so index.html is nested

JS toolchains output dist/index.html. If you zip the folder named dist from its parent, the archive root becomes dist/index.html. The site root has no index.html, so / 404s under =404.

Always zip the contents of dist (or configure your upload tool to treat dist as the site root). Unzip to a temporary directory and ls the top level before production deploys. This mistake is independent of React vs Vue; it is archive shape. Nested zips create false emergencies that look like “hosting is broken.”

When to pick a different product

Pick a Node host or serverless platform when you need SSR on each request. Pick a JAMstack platform that documents SPA fallback if you refuse to pre-render and must keep history-mode deep links. Pick PHP hosts for WordPress. Pick mail vendors for inboxes. Pick forever-free Pages for hobby demos if $0 forever is required.

Stay on StaticHost when the app is truly static assets talking to external APIs, and you own the build. Scale ($65) and Business ($130) raise site/storage/team ceilings—not remote build or CDN mythology.

Environment variables and secrets

Anything prefixed for the client is public in the bundle. Do not put private API secrets in front-end env files and hope the host hides them—StaticHost serves files. Keep secrets on your API. Rebuild when public endpoints change; there is no server-side env injection for static files at request time.

Framework-specific reminders

  • Vite/React/Vue/Svelte: prefer SSG plugins or hash mode for compatibility.
  • Next static export: only features compatible with export; no server routes on StaticHost.
  • Astro: static output fits cleanly when you emit pages.
  • Gatsby: upload public/ after local build.

Always verify deep links on HTTPS preview before ads or client demos.

FAQ

Does StaticHost install my package.json on push?

No. CI or your laptop runs npm; the host receives files.

Can I enable SPA fallback with a config file?

No. The product is =404. Change the app or the host category.

Is email included for transactional app mail?

No. App mail belongs in your backend/mail vendor.

Is there a free forever tier for JS demos?

No. Short trial, then $9/$30/$65/$130.