-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
43 lines (42 loc) · 1.02 KB
/
vite.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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsconfigPaths from 'vite-tsconfig-paths';
import { VitePWA } from 'vite-plugin-pwa';
import { manifestOption } from './manifestOption';
export default defineConfig({
server: {
port: 3000,
},
plugins: [
react(),
viteTsconfigPaths(),
VitePWA({
registerType: 'autoUpdate',
devOptions: {
enabled: true,
},
manifest: manifestOption,
workbox: {
runtimeCaching: [
{
urlPattern: /^https:\/\/openweathermap\.org\/img\/wn\/.*\.png$/i,
handler: 'CacheFirst',
options: {
cacheName: 'openweathermap-icons',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 30, // 30 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
}),
],
build: {
outDir: 'build',
},
});