-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.ts
53 lines (51 loc) · 1.3 KB
/
astro.config.ts
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
import mdx from "@astrojs/mdx";
import node from "@astrojs/node";
import vercel from "@astrojs/vercel/serverless";
import AstroPWA from "@vite-pwa/astro";
import { defineConfig } from "astro/config";
import manifest from "./src/pwa/webmanifest.json";
import type { ManifestOptions } from "vite-plugin-pwa";
const adapter =
process.env.ADAPTER === "node"
? node({
mode: "standalone",
})
: vercel({
imageService: true,
imagesConfig: {
domains: [],
sizes: [320, 640, 1280],
},
});
// https://astro.build/config
export default defineConfig({
site: "https://astro-pwa-recipe.vercel.app/",
base: "/",
output: "hybrid",
adapter,
integrations: [
mdx(),
AstroPWA({
strategies: "injectManifest",
srcDir: "src/pwa",
filename: "sw.ts",
injectManifest: {
globPatterns: [
"_astro/*.{css,js}",
"journal/**/index.html",
"pwa-192x192.png",
"**/offline/index.html",
],
},
injectRegister: false,
manifest: manifest as Partial<ManifestOptions>,
mode: "production",
scope: "/",
includeAssets: ["favicon.svg"],
registerType: "autoUpdate",
experimental: {
directoryAndTrailingSlashHandler: true,
},
}),
],
});