aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/module_loader.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/module_loader.zig')
-rw-r--r--src/bun.js/module_loader.zig19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bun.js/module_loader.zig b/src/bun.js/module_loader.zig
index 0e4cb5ba2..4763ed1bc 100644
--- a/src/bun.js/module_loader.zig
+++ b/src/bun.js/module_loader.zig
@@ -450,6 +450,25 @@ pub const RuntimeTranspilerStore = struct {
return;
};
+ if (vm.isWatcherEnabled()) {
+ if (input_file_fd != 0) {
+ if (vm.bun_watcher != null and !is_node_override and
+ std.fs.path.isAbsolute(path.text) and !strings.contains(path.text, "node_modules"))
+ {
+ should_close_input_file_fd = false;
+ vm.bun_watcher.?.addFile(
+ input_file_fd,
+ path.text,
+ hash,
+ loader,
+ 0,
+ package_json,
+ true,
+ ) catch {};
+ }
+ }
+ }
+
for (parse_result.ast.import_records.slice()) |*import_record_| {
var import_record: *bun.ImportRecord = import_record_;