We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4241a5a commit 902d273Copy full SHA for 902d273
src/core/unplugin.ts
@@ -1,4 +1,5 @@
1
import type { Options } from '../types'
2
+import path from 'node:path'
3
import { slash } from '@antfu/utils'
4
import { isPackageExists } from 'local-pkg'
5
import pm from 'picomatch'
@@ -41,7 +42,8 @@ export default createUnplugin<Options>((options) => {
41
42
}
43
},
44
async handleHotUpdate({ file }) {
- if (ctx.dirs?.some(dir => pm.isMatch(slash(file), slash(typeof dir === 'string' ? dir : dir.glob))))
45
+ const relativeFile = path.relative(ctx.root, slash(file))
46
+ if (ctx.dirs?.some(dir => pm.isMatch(slash(relativeFile), slash(typeof dir === 'string' ? dir : dir.glob))))
47
await ctx.scanDirs()
48
49
async configResolved(config) {
0 commit comments