-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix CoffeeScript CJS + ESM #3
Conversation
// empty object is returned for the module's exports. | ||
// the import does NOT hit ESMLoader or its CJS strategy. | ||
ok(!stdout.includes('Hello from CommonJS!'), 'Named CommonJS import fails'); | ||
ok(stdout.includes('Hello from CommonJS!'), 'Named CommonJS import fails'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this pass now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what did the trick was adding module._compile
, it looks like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes adding module._compile
was the critical piece. coffeescript/register
called it in their implementation so I looked to see what was different here.
Added call to
module._compile
to fix CJS loading in combo mode.Also refactored out
compile
helper method for compiling CoffeeScript.