Skip to content

Commit

Permalink
limit to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
paperclover committed Jan 8, 2025
1 parent df2c359 commit 555d004
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/js_printer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5772,7 +5772,11 @@ pub fn printAst(
imported_module_ids_list = printer.imported_module_ids;
}

if (!opts.bundling and tree.uses_require_ref and tree.exports_kind == .esm) {
if (!opts.bundling and
tree.uses_require_ref and
tree.exports_kind == .esm and
opts.target == .bun)
{
// Hoist the `var {require}=import.meta;` declaration. Previously,
// `import.meta.require` was inlined into transpiled files, which
// meant calling `func.toString()` on a function with `require`
Expand Down

0 comments on commit 555d004

Please sign in to comment.