chore(pwa): change sw generation logic (#2494)
This commit is contained in:
parent
21376e013a
commit
5503ecbea2
3 changed files with 37 additions and 29 deletions
|
@ -15,16 +15,6 @@ 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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue