-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
59 lines (57 loc) · 1.49 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
VitePWA({
base: '/',
strategies: 'injectManifest',
registerType: 'autoUpdate',
injectRegister: null,
manifest: {
name: 'yaranai',
short_name: 'yaranai',
description: '新感覚タスク管理アプリ',
icons: [
{
src: '/favicon.ico',
sizes: '32x32',
type: 'image/png'
}
], // あとで追加します
start_url: '/',
display: 'standalone', // デフォルトなので不要
background_color: '#ffffff',
theme_color: '#ffffff',
lang: 'ja'
},
workbox: {
cleanupOutdatedCaches: true,
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
runtimeCaching: [
{
handler: 'NetworkOnly',
urlPattern: /\/api/,
method: 'POST',
options: { backgroundSync: { name: 'lll', options: { maxRetentionTime: 24 * 60 } } }
}
]
},
includeAssets: ['favicon.ico', 'logo.svg'],
devOptions: {
enabled: false,
suppressWarnings: true
},
srcDir: 'src',
filename: 'sw.ts'
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})