fix build

This commit is contained in:
Henry Jameson 2026-06-16 19:07:27 +03:00
commit 01ceb957ee
4 changed files with 11 additions and 8 deletions

View file

@ -102,8 +102,12 @@ export const buildSwPlugin = ({ swSrc, swDest }) => {
},
})
const swBundle = await build(config)
return swBundle.output[0]
try {
const swBundle = await build(config)
return swBundle.output[0]
} catch (e) {
console.error('Error building ServiceWorker:' , e)
}
},
},
closeBundle: {
@ -112,7 +116,11 @@ export const buildSwPlugin = ({ swSrc, swDest }) => {
async handler() {
if (process.env.VITEST) return
console.info('Building service worker for production')
await build(config)
try {
await build(config)
} catch (e) {
console.error('Error building ServiceWorker:' , e)
}
},
},
}