Skip to content

Commit 6dd76a5

Browse files
tangye1234Ye Tang
andauthored
fix: also add dependency path to loaderContext for virtual module hmr (#556)
Co-authored-by: Ye Tang <ye.tang@rightcapital.com>
1 parent 12b564c commit 6dd76a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rspack/context.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export function createBuildContext(compiler: Compiler, compilation: Compilation,
1717
},
1818
addWatchFile(file) {
1919
const cwd = process.cwd()
20-
compilation.fileDependencies.add(resolve(cwd, file))
20+
const resolvedPath = resolve(cwd, file)
21+
compilation.fileDependencies.add(resolvedPath)
22+
loaderContext?.addDependency(resolvedPath)
2123
},
2224
getWatchFiles() {
2325
return Array.from(compilation.fileDependencies)

0 commit comments

Comments
 (0)