chore: add generate pwa icons script (#2130)

This commit is contained in:
Joaquín Sánchez 2023-05-29 16:52:27 +02:00 committed by GitHub
parent 0767df3f78
commit d601a117c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 449 additions and 9 deletions

View file

@ -15,6 +15,16 @@ export const pwa: VitePWANuxtOptions = {
injectManifest: {
globPatterns: ['**/*.{js,json,css,html,txt,svg,png,ico,webp,woff,woff2,ttf,eot,otf,wasm}'],
globIgnores: ['emojis/**', 'shiki/**', 'manifest**.webmanifest'],
manifestTransforms: [(entries) => {
const manifest = entries.map((entry) => {
if (entry.url.length > 1 && entry.url[0] !== '/')
entry.url = `/${entry.url}`
return entry
})
return { manifest, warnings: [] }
}],
},
devOptions: {
enabled: process.env.VITE_DEV_PWA === 'true',