-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
55 lines (53 loc) · 1.41 KB
/
astro.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// @ts-check
import { defineConfig } from "astro/config";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import AstroPWA from "@vite-pwa/astro";
import compress from "astro-compress";
import { manifest, seoConfig } from "./src/lib/utils";
// https://astro.build/config
export default defineConfig({
site: seoConfig.baseURL,
prefetch: {
prefetchAll: true,
defaultStrategy: "viewport",
},
integrations: [
react(),
tailwind({
applyBaseStyles: false,
configFile: "./tailwind.config.mjs",
}),
sitemap(),
compress(),
AstroPWA({
strategies: "generateSW",
manifest,
registerType: "autoUpdate",
workbox: {
globDirectory: "dist",
globPatterns: [
"**/!(404).{html,js,css,svg,png,jpg,jpeg,gif,webp,woff,woff2,ttf,eot,ico,webmanifest}",
],
navigateFallback: null,
clientsClaim: true,
skipWaiting: true,
runtimeCaching: [
{
urlPattern:
/\.(?:html|js|css|svg|png|jpg|jpeg|gif|webp|woff|woff2|ttf|eot|ico|webmanifest)$/,
handler: "NetworkFirst",
options: {
cacheName: "assets",
expiration: {
maxAgeSeconds: 604800, // 1 week
},
},
},
],
},
}),
],
devToolbar: { enabled: false },
});