Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
fix: improve nitro config to fix nuxi generate
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmarrec committed Oct 11, 2022
1 parent db22036 commit b322220
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/parts/workbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ export default async (pwa: PWAContext) => {
// Register Service Worker
if (options.autoRegister) {
nuxt.hook('nitro:config', (config) => {
const plugin = pwa._resolver.resolve('./runtime/nitro-plugin')
config.externals = config.externals || {}
config.externals.inline = config.externals.inline || []
config.externals.inline.push(plugin)
config.plugins = config.plugins || []
config.plugins.push(pwa._resolver.resolve('./runtime/nitro-plugin'))
config.plugins.push(plugin)
})
}
}

0 comments on commit b322220

Please sign in to comment.