Skip to content

Commit 94738ba

Browse files
committed
Add workbox
1 parent baf21af commit 94738ba

File tree

5 files changed

+4285
-156
lines changed

5 files changed

+4285
-156
lines changed

astro.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import rehypeAutolinkHeadings from "rehype-autolink-headings";
99
import metaTags from "astro-meta-tags";
1010
import pagefind from "astro-pagefind";
1111
import deleteUnusedImages from "astro-delete-unused-images";
12+
import serviceWorker from "astrojs-service-worker";
1213
import { execSync } from "node:child_process";
1314

1415
import compress from "astro-compress";
@@ -110,6 +111,10 @@ export default defineConfig({
110111
metaTags(),
111112
pagefind(),
112113
deleteUnusedImages(),
114+
serviceWorker({
115+
workbox: { inlineWorkboxRuntime: true },
116+
enableInDevelopment: true,
117+
}),
113118
compress({
114119
SVG: false,
115120
}),
@@ -123,4 +128,7 @@ export default defineConfig({
123128
remotePatterns: [{ protocol: "https" }],
124129
domains: ["programme.europython.eu", "placehold.co"],
125130
},
131+
prefetch: {
132+
prefetchAll: true,
133+
},
126134
});

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"astro-meta-tags": "^0.3.1",
2525
"astro-pagefind": "^1.8.3",
2626
"astro-preload": "^1.1.2",
27+
"astrojs-service-worker": "^2.0.0",
2728
"clsx": "^2.1.1",
2829
"date-fns": "^4.1.0",
2930
"date-fns-tz": "^3.2.0",
@@ -40,6 +41,7 @@
4041
},
4142
"devDependencies": {
4243
"@types/js-yaml": "^4.0.9",
44+
"@vitejs/plugin-basic-ssl": "^2.0.0",
4345
"prettier": "^3.5.3",
4446
"prettier-plugin-astro": "^0.14.1",
4547
"puppeteer": "^24.7.2",

0 commit comments

Comments
 (0)