aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/javascript.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-08-25 21:08:41 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-25 21:08:41 -0700
commitd98a93c3181426ea0565193303d3e63d3796231c (patch)
tree71a8d96bc4b75d902643ec877c03070cca8fcf45 /src/bun.js/javascript.zig
parentf70bb2497b2406e89afec3ee8a36a3b10ef66334 (diff)
downloadbun-d98a93c3181426ea0565193303d3e63d3796231c.tar.gz
bun-d98a93c3181426ea0565193303d3e63d3796231c.tar.zst
bun-d98a93c3181426ea0565193303d3e63d3796231c.zip
Automatically hot reload Bun.serve() (#4344)
* Automatically hot reload Bun.serve() * Update doc * Update example --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/javascript.zig')
-rw-r--r--src/bun.js/javascript.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig
index 01f6383af..fc2bd7a05 100644
--- a/src/bun.js/javascript.zig
+++ b/src/bun.js/javascript.zig
@@ -766,6 +766,14 @@ pub const VirtualMachine = struct {
return debugger.next_debugger_id;
}
+ pub fn hotMap(this: *VirtualMachine) ?*JSC.RareData.HotMap {
+ if (this.hot_reload != .hot) {
+ return null;
+ }
+
+ return this.rareData().hotMap(this.allocator);
+ }
+
pub var has_created_debugger: bool = false;
pub const Debugger = struct {