aboutsummaryrefslogtreecommitdiff
path: root/src/js_parser/js_parser.zig
diff options
context:
space:
mode:
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;