|
All checks were successful
continuous-integration/drone/push Build is passing
The SPA references content-hashed bundles under /_app/immutable/ embedded in the binary. After a deploy the binary ships new hashes and drops the old ones, so a browser reusing a cached HTML page (or a stale /_app bundle) requests hashes that 404: the page renders but the app never starts, leaving it visible but frozen. - routes.go: serve the page HTML (and the rewritten manifest.json) with Cache-Control no-cache so clients always revalidate and load a page that points at bundles which actually exist; /_app/* stays immutable. - routes.go: when a missing /_app/immutable/*.js is requested (a stale cached client), return a self-healing reload module (200) instead of a dead 404 so already-stuck clients recover on their own. The reload module is issued synchronously and throws at the end of evaluation so the failing import() rejects: SvelteKit's bootstrap never reaches kit.start(...), avoiding a "kit.start is not a function" TypeError. We do not touch the Cache Storage API: the service worker manages its own cache lifecycle and async caches.* work would lose the race against kit.start. |
||
|---|---|---|
| .. | ||
| src | ||
| static | ||
| .gitignore | ||
| .prettierignore | ||
| assets-noui.go | ||
| assets.go | ||
| generate_npm.go | ||
| openapi-ts.config.ts | ||
| package.json | ||
| README.md | ||
| routes.go | ||
| svelte.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
create-svelte
Everything you need to build a Svelte project, powered by create-svelte.
Creating a project
If you're seeing this, you've probably already done this step. Congrats!
# create a new project in the current directory
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-app
Developing
Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Building
To create a production version of your app:
npm run build
You can preview the production build with npm run preview.
To deploy your app, you may need to install an adapter for your target environment.