diff options
author | 2021-12-16 01:48:50 -0800 | |
---|---|---|
committer | 2021-12-16 01:48:50 -0800 | |
commit | 39af1ccc7c677a70a1715ecef562b7cda31a7857 (patch) | |
tree | 0fd3e862abff64a120519eea998f286b1787aaa0 | |
parent | 52f4ba767acb3d063e53d073989f91a407a7df61 (diff) | |
download | bun-39af1ccc7c677a70a1715ecef562b7cda31a7857.tar.gz bun-39af1ccc7c677a70a1715ecef562b7cda31a7857.tar.zst bun-39af1ccc7c677a70a1715ecef562b7cda31a7857.zip |
Update js_printer.zig
-rw-r--r-- | src/js_printer.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/js_printer.zig b/src/js_printer.zig index bbdd563c9..624bc2246 100644 --- a/src/js_printer.zig +++ b/src/js_printer.zig @@ -3518,7 +3518,14 @@ pub fn NewPrinter( return; } - p.printSymbol(p.options.runtime_imports.__require.?.ref); + // the require symbol may not exist in bundled code + // it is included at the top of the file. + if (comptime is_inside_bundle) { + p.print("__require"); + } else { + p.printSymbol(p.options.runtime_imports.__require.?.ref); + } + // d is for default p.print(".d("); p.printLoadFromBundle(require.import_record_index); |