bun
bun copied to clipboard
[bun build] in cjs node, dont convert `module` to `require.module`
What does this PR do?
fixes #20308
Context: module gets converted to require.module in --format=cjs --target=node, unfortunately that isn't actually a thing in node/bun so this pr lets it stay to the base module. I'm not sure if this is the right way of going about it and if it effects esm outputs.
- [ ] Documentation or TypeScript types (it's okay to leave the rest blank in this case)
- [ ] Code changes
How did you verify your code works?
modified existing test to fit cjs mode, and ran it
:x: @RiskyMH, your commit 1a82d565b3423fd5406adf82f1334d2a3c2ff54b has 1 failures in Build #18556:
test/js/bun/spawn/spawn.test.ts- 1 failing on 🪟 2019 x64-baselinetest/js/bun/spawn/spawn.test.ts- 1 failing on 🪟 2019 x64
🧪 To try this PR locally:
bunx bun-pr 20343
That installs a local version of the PR into your bun-20343 executable, so you can run:
bun-20343 --bun
I don't think it should ever be require.module? I think this code probably meant module.require which should work
I don't think it should ever be require.module? I think this code probably meant module.require which should work
The earlier line (if (p.options.require_ref) |require| { p.printSymbol(require);) is what is used for the esm path. If I get rid of that code then the test right before the one I added fails. So I'd assume it is intended outcome, just not for cjs format.