-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
63 lines (57 loc) · 1.74 KB
/
Copy pathvite.config.js
File metadata and controls
63 lines (57 loc) · 1.74 KB
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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
// import { registerSW } from "virtual:pwa-register";
// if ("serviceWorker" in navigator) {
// // && !/localhost/.test(window.location)) {
// registerSW();
// }
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
VitePWA({
includeAssets: ['favicon.ico', 'robots.txt', 'src/assets/**/*'],
registerType: 'autoUpdate',
devOptions: {
enabled: true
},
// includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'masked-icon.svg'],
manifest: {
name: 'TaskFocus',
short_name: 'TaskFocus',
description: 'Website description(Could be same with index.html file)',
icons: [
{
src: '/pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src:'/maskable_icon.png',
sizes: '1024x1024',
type: 'image/png',
}
],
theme_color: '#ffffff',
background_color: '#01051e',
// display: 'standalone',
display: 'fullscreen',
scope: '/',
start_url: '/',
orientation: 'portrait,landscape',
},
workbox:{
// globDirectory: 'src/assets', // Specify the base directory
// globPatterns: ['**/*.{png,jpg,jpeg,gif,svg}'], // Match image file extensions
globPatterns: ['**/*.{js,css,html,png,jpg,jpeg,gif,svg,ico,json}'],
},
// includeAssets: ['favicon.ico', 'robots.txt', 'src/assets/**'],
})
],
})