-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.js
44 lines (41 loc) · 1014 Bytes
/
vite.config.js
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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import svgr from "vite-plugin-svgr";
import { VitePWA } from "vite-plugin-pwa";
// const getCache = ({ name, pattern }) => ({
// urlPattern: pattern,
// handler: "CacheFirst",
// options: {
// cacheName: name,
// expiration: {
// maxEntries: 500,
// maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
// },
// cacheableResponse: {
// statuses: [0, 200],
// },
// },
// });
export default defineConfig({
plugins: [
react(),
svgr(),
VitePWA({
workbox: {
offlineGoogleAnalytics: true,
// runtimeCaching: [
// getCache({
// name: "youtube-assets",
// // pattern: /^https:\/\/i.ytimg.com\/vi/,
// pattern: ({ url }) => url.origin === "https://i.ytimg.com",
// }),
// ],
},
includeAssets: ["**/*"],
manifest: false,
}),
],
build: {
outDir: "build",
},
});