feat: inject sw script to pages

This commit is contained in:
Pooya Parsa 2020-11-05 22:40:25 +01:00
parent 360bba7d80
commit 6e1678316e
2 changed files with 5 additions and 0 deletions

View File

@ -33,6 +33,7 @@ export interface SLSOptions {
version: string
}
hooks: { [key: string]: any } // TODO: export from hookable
nuxtHooks: NuxtOptions['hooks']
}
export interface SLSConfig extends Omit<Partial<SLSOptions>, 'targetDir'> {

View File

@ -26,6 +26,10 @@ export default <Module> function slsModule () {
]))
}
if (options.nuxtHooks) {
nuxt.addHooks(options.nuxtHooks)
}
nuxt.hook('generate:cache:ignore', (ignore) => {
ignore.push(options.slsDir)
})