-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
159 lines (158 loc) · 4.26 KB
/
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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import path from "path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { VitePWA } from "vite-plugin-pwa";
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
plugins: [
vue(),
VitePWA({
registerType: "autoUpdate",
devOptions: {
enabled: true,
},
workbox: {
globPatterns: ["**/*.{js,css,html,ico,png,svg,vue}"],
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: /\.(?:png|gif|jpg|jpeg|svg,ico)$/,
handler: "CacheFirst",
options: {
cacheName: "assets",
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 30, // <== 30 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],
},
},
},
],
},
includeAssets: [
"favicon.ico",
"apple-touch-icon.png",
"fonts/*.ttf",
"images/*.png",
],
manifest: {
name: "Tomodo",
short_name: "Tomodo",
start_url: "/",
description:
"Tomodo is application to do list for make human productive. Create todo right now, let's do great today, don't busy be productive.",
theme_color: "#ffffff",
screenshots: [
{
src: "screenshots/wide-1.jpg",
sizes: "768x432",
form_factor: "wide",
label: "home",
},
{
src: "screenshots/wide-2.jpg",
sizes: "768x432",
form_factor: "wide",
label: "detail collection",
},
{
src: "screenshots/wide-3.jpg",
sizes: "768x432",
form_factor: "wide",
label: "import collection",
},
{
src: "screenshots/wide-4.jpg",
sizes: "768x432",
form_factor: "wide",
label: "form update collection",
},
{
src: "screenshots/narrow-1.jpg",
sizes: "375x667",
form_factor: "narrow",
label: "home",
},
{
src: "screenshots/narrow-2.jpg",
sizes: "375x667",
form_factor: "narrow",
label: "detail collection",
},
{
src: "screenshots/narrow-3.jpg",
sizes: "375x667",
form_factor: "narrow",
label: "update collection",
},
{
src: "screenshots/narrow-4.jpg",
sizes: "375x667",
form_factor: "narrow",
label: "import collection",
},
],
shortcuts: [
{
name: "Import Collection",
short_name: "Import",
description: "Import the collection",
url: "/import",
icons: [
{
src: "icons/pwa-import-white.png",
sizes: "192x192",
},
],
},
],
icons: [
{
src: "icons/android-chrome-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "icons/android-chrome-512x512.png",
sizes: "512x512",
type: "image/png",
},
],
},
}),
],
});