Skip to content

Commit

Permalink
fix: adopt forward-compatible approach to builder:watch (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Mar 27, 2024
1 parent bf15c89 commit 1347207
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/loader.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { relative, resolve } from 'node:path'
import type { Nuxt } from '@nuxt/schema'
import defu from 'defu'
import { debounce } from 'perfect-debounce'
Expand Down Expand Up @@ -105,6 +106,7 @@ export function registerWatcher(options: VuetifyModuleOptions, nuxt: Nuxt, ctx:
let pageReload: (() => Promise<void>) | undefined

nuxt.hooks.hook('builder:watch', (_event, path) => {
path = relative(nuxt.options.srcDir, resolve(nuxt.options.srcDir, path))
if (!pageReload && ctx.vuetifyFilesToWatch.includes(path))
return nuxt.callHook('restart')
})
Expand Down

0 comments on commit 1347207

Please sign in to comment.