Skip to content

Instantly share code, notes, and snippets.

@MarshallOfSound
Created April 5, 2026 00:10
Show Gist options
  • Select an option

  • Save MarshallOfSound/24cbe8288ceb0bac38c3dcdae87c4c9e to your computer and use it in GitHub Desktop.

Select an option

Save MarshallOfSound/24cbe8288ceb0bac38c3dcdae87c4c9e to your computer and use it in GitHub Desktop.
esbuild __toCommonJS identity regression repro

esbuild __toCommonJS identity regression repro

npm i esbuild
npx esbuild entry.js --bundle | node

Expected: a === b: true (matches Node CJS semantics, webpack, and esbuild ≤ 0.14.26) Actual: a === b: false

const a = require('./esm-mod');
const b = require('./esm-mod');
console.log('a === b:', a === b);
export const value = 42;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment