Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/good-seahorses-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': minor
---

feat: expose `paths` to service workers
1 change: 1 addition & 0 deletions packages/kit/src/exports/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ export const files = [
.map((asset) => `${JSON.stringify(`${config.kit.paths.base}/${asset.file}`)}`)
.join(',\n\t\t\t\t')}
];
export const paths = ${JSON.stringify(config.kit.paths)};
export const prerendered = [];
export const version = ${JSON.stringify(config.kit.version.name)};
`;
7 changes: 7 additions & 0 deletions packages/kit/types/ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ declare module '$service-worker' {
* See [`config.kit.version`](https://kit.svelte.dev/docs/configuration#version). It's useful for generating unique cache names inside your service worker, so that a later deployment of your app can invalidate old caches.
*/
export const version: string;
/**
* See [`config.kit.paths`](https://kit.svelte.dev/docs/configuration#paths).
*/
export const paths: {
assets: string;
base: string;
};
}

declare module '@sveltejs/kit/hooks' {
Expand Down