Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore CommonJS to CompartmentMapper #501

Closed
kriskowal opened this issue Oct 23, 2020 · 1 comment · Fixed by #666 or #668
Closed

Restore CommonJS to CompartmentMapper #501

kriskowal opened this issue Oct 23, 2020 · 1 comment · Fixed by #666 or #668
Assignees

Comments

@kriskowal
Copy link
Member

#500 removes support for CommonJS from Compartment Mapper to eliminate a dependency on Babel that interferes with RESM+Rollup by capturing a dependency on the Node.js readable stream built-in-module.

To get CommonJS back, it might be better to borrow @guybedford’s lexer, convert it to ESM, and teach it to discover static requires in addition to exports and reexports:

https://github.com/guybedford/cjs-module-lexer/blob/master/lexer.js

@guybedford
Copy link

There is already a PR to capture static requires in nodejs/cjs-module-lexer#10.

Please be my guest in forking and using that further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants