-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.config.ts
134 lines (127 loc) · 4.16 KB
/
app.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// import { VitePWA, type ManifestOptions, type VitePWAOptions } from 'vite-plugin-pwa'
import { defineConfig } from "@solidjs/start/config";
// const pwaOptions: Partial<VitePWAOptions> = {
// base: "/",
// includeAssets: ["favicon.ico"],
// strategies: 'generateSW',
// workbox: {
// navigateFallback: "/",
// navigateFallbackDenylist: [/\/admin\/*/],
// runtimeCaching: [{
// urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
// handler: 'CacheFirst',
// options: {
// cacheName: 'google-fonts-cache',
// expiration: {
// maxEntries: 10,
// maxAgeSeconds: 60 * 60 * 24 * 365 // <== 365 days
// },
// cacheableResponse: {
// statuses: [0, 200]
// }
// }
// }, {
// urlPattern: /^https:\/\/fonts\.gstatic\.com\/.*/i,
// handler: 'CacheFirst',
// options: {
// cacheName: 'gstatic-fonts-cache',
// expiration: {
// maxEntries: 10,
// maxAgeSeconds: 60 * 60 * 24 * 365 // <== 365 days
// },
// cacheableResponse: {
// statuses: [0, 200]
// },
// }
// }, {
// urlPattern: (t) => t.request.destination === "document" && t.sameOrigin,
// handler: 'NetworkFirst',
// method: "GET",
// options: {
// cacheName: "pages",
// expiration: {
// maxEntries: 10
// },
// cacheableResponse: {
// statuses: [0, 200]
// },
// matchOptions: {
// ignoreSearch: true
// },
// }
// }]
// },
// manifest: {
// name: "Buntu Cossie's Portfolio App",
// short_name: "cossie.dev",
// display: "standalone",
// theme_color: "#141b26",
// background_color: "#2f4f4f",
// start_url: "/",
// orientation: "portrait-primary",
// id: "/",
// description: "Portfolio page of full-stack developer Buntu Cossie",
// icons: [{
// src: "favicon.ico",
// sizes: "48x48",
// type: "image/x-icon"
// }, {
// src: "logo192.png",
// type: "image/png",
// sizes: "192x192"
// }, {
// src: "logo512.png",
// type: "image/png",
// sizes: "512x512",
// purpose: "any maskable"
// }],
// },
// devOptions: {
// enabled: true,
// /* when using generateSW the PWA plugin will switch to classic */
// type: 'module',
// },
// }
// const replaceOptions = { __DATE__: new Date().toISOString() }
// const claims = process.env.CLAIMS === 'true'
// const reload = process.env.RELOAD_SW === 'true'
// const selfDestroying = process.env.SW_DESTROY === 'true'
// if (process.env.SW === 'true') {
// pwaOptions.srcDir = 'src'
// pwaOptions.filename = claims ? 'claims-sw.ts' : 'prompt-sw.ts'
// pwaOptions.strategies = 'injectManifest';
// (pwaOptions.manifest as Partial<ManifestOptions>).name = 'PWA Inject Manifest';
// (pwaOptions.manifest as Partial<ManifestOptions>).short_name = 'PWA Inject'
// }
// if (claims)
// pwaOptions.registerType = 'autoUpdate'
// if (reload) {
// // @ts-expect-error just ignore
// replaceOptions.__RELOAD_SW__ = 'true'
// }
// if (selfDestroying)
// pwaOptions.selfDestroying = selfDestroying
export default defineConfig({
server: {
preset: 'vercel',
prerender: {
routes: ["/", "/about", "/contact", "/projects", "/api"],
ignore: ["/admin"]
},
},
vite: {
css: {
preprocessorOptions: {
scss: {
api: 'modern'
}
}
}
}
// ssr: {
// external: ['ag-grid-solid'],
// },
// plugins: [
// VitePWA(pwaOptions),
// ],
});