Skip to content

Commit afeab8c

Browse files
committed
fix(watch): watch relative files
1 parent 49c045b commit afeab8c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/features/watch.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'node:path'
12
import { blue } from 'ansis'
23
import { RE_NODE_MODULES } from 'rolldown-plugin-dts/filename'
34
import {
@@ -35,6 +36,7 @@ export async function watchBuild(
3536
const debouncedOnChange = debounce(onChange, 100)
3637

3738
const watcher = watch(files, {
39+
cwd: options.cwd,
3840
ignoreInitial: true,
3941
ignorePermissionErrors: true,
4042
ignored: [
@@ -48,7 +50,7 @@ export async function watchBuild(
4850
let pending: string[] = []
4951
let pendingPromise: Promise<void> | undefined
5052
watcher.on('all', (type, file) => {
51-
pending.push(file)
53+
pending.push(path.resolve(options.cwd, file))
5254
debouncedOnChange()
5355
})
5456

0 commit comments

Comments
 (0)