Skip to content

Commit

Permalink
fix: adopt forward-compatible approach to builder:watch (#637)
Browse files Browse the repository at this point in the history
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
danielroe and autofix-ci[bot] committed Apr 8, 2024
1 parent 6832cdf commit 800d71f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/devtools/src/server-rpc/assets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parse, relative } from 'node:path'
import fsp from 'node:fs/promises'
import { parse } from 'node:path'
import { join, resolve } from 'pathe'
import { imageMeta } from 'image-meta'
import { debounce } from 'perfect-debounce'
Expand All @@ -21,6 +21,7 @@ export function setupAssetsRPC({ nuxt, ensureDevAuthToken, refresh, options }: N
}, 500)

nuxt.hook('builder:watch', (event, key) => {
key = relative(nuxt.options.srcDir, resolve(nuxt.options.srcDir, key))
if (key.startsWith(nuxt.options.dir.public) && (event === 'add' || event === 'unlink'))
refreshDebounced()
})
Expand Down

0 comments on commit 800d71f

Please sign in to comment.