aboutsummaryrefslogtreecommitdiff
path: root/src/js_parser/js_parser.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-08-25 17:56:06 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-08-25 17:56:06 -0700
commit454160646923e98f00e53df025e324d3d2c585d0 (patch)
tree731c5243ac48077ffa1f974dcf46f3bc176792b6 /src/js_parser/js_parser.zig
parent039bf6ecdb0be85ca78045b647de01bd176823c6 (diff)
downloadbun-454160646923e98f00e53df025e324d3d2c585d0.tar.gz
bun-454160646923e98f00e53df025e324d3d2c585d0.tar.zst
bun-454160646923e98f00e53df025e324d3d2c585d0.zip
latest
Former-commit-id: f5600d123d3710e7ea80ff2b7c66d13382462420
Diffstat (limited to 'src/js_parser/js_parser.zig')
-rw-r--r--src/js_parser/js_parser.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/js_parser/js_parser.zig b/src/js_parser/js_parser.zig
index 9d37230cd..28e2e04b1 100644
--- a/src/js_parser/js_parser.zig
+++ b/src/js_parser/js_parser.zig
@@ -2182,6 +2182,14 @@ pub const Parser = struct {
if (p.options.transform_require_to_import) {
var args = p.allocator.alloc(Expr, 2) catch unreachable;
wrapper_expr = p.callRuntime(logger.Loc.Empty, "__commonJS", args);
+
+ // Disable HMR if we're wrapping it in CommonJS
+ // It's technically possible to support this.
+ // But we need to cut scope for the v0.
+ p.options.features.hot_module_reloading = false;
+ p.runtime_imports.__HMRModule = null;
+ p.runtime_imports.__FastRefreshModule = null;
+ p.runtime_imports.__HMRClient = null;
}
} else {
exports_kind = .esm;