aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-07-27 15:52:52 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-27 15:52:52 -0700
commit16a7224ce5de519afa4765594d45350c95a87adc (patch)
treee2cac122fd328e88dad86eb726696752e244351e /src/bun.js
parent7c44773f38bb68fc9dbddc755b636b3392ce83aa (diff)
downloadbun-16a7224ce5de519afa4765594d45350c95a87adc.tar.gz
bun-16a7224ce5de519afa4765594d45350c95a87adc.tar.zst
bun-16a7224ce5de519afa4765594d45350c95a87adc.zip
Fix hot reloading in canary (#3848)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js')
-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_;