forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Description
Describe the bug
esbuild transforms const
and let
to var
, whereas rolldown does not. This can lead to TDZ errors and incompatibility with vite-plugin-node-polyfills.

// input
const global = globalThis || self;
export { global as default, global };
// esbuild
var global = globalThis || self;
export {
global as default,
global
};
// rolldown
//#region index.ts
const global = globalThis || self;
//#endregion
export { global as default, global };
Reproduction
Steps to reproduce
Try esbuild and rolldown on the reproduction
System Info
N/A
Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs and the Rolldown-related guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.