You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
commonjs: Object.defineProperty(exports, "__esModule", …) leaves unbound exports when module is wrapped #2041
When a CommonJS module's only reference to exports is a top-level Object.defineProperty(exports, "__esModule", { value: true }) and the module also references module, m.js should either receive (module, exports) in the wrapper or have exports rewritten, matching Node's CommonJS wrapper where both module and exports are in scope.
Actual Behavior
The module is wrapped in (function (module) { ... }()) without passing exports or rewriting the defineProperty call. Running the generated ES bundle throws ReferenceError: exports is not defined in ES module scope because requireM emits a free exports identifier inside the wrapper:
The CallExpression handler for __esModule skips exports without marking uses.exports = true, so wrapping triggered by uses.module omits exports from the wrapper parameters.
Activity