-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
add zero-config support for loading ES modules in Node #3695
Conversation
@jdalton I can push code to your branch? didn’t realize that was a thing. |
@boneskull Yep, it's a thing 🎉 Update: PS: I think the one test fail in Node 6 on travis-ci might be a false fail. |
restarting the job... I haven't seen flake in those tests before. |
this closes #3006 |
Ah ok. Thank you. It looks like that test still fails so I'll dig in. |
sorry about the rebase, I’m stepping on your toes here. let me know when you’re done |
(no worries, rebase away) Update: I narrowed down the bug. Update: Turned out to be a timing issue. |
So this will get To mitigate this, I'm thinking we should do one or more of:
@jdalton Looking for some recommendations from you here... you will know better what we should be cautious about. |
@mochajs/core What are your thoughts on releasing this in v6? v6.1? v7? |
Thanks @boneskull! You could check for the Node flag While the An on-by-default might help folks realize they don't need to include Babel. Though I can understand if, when flighted, there are issues that it goes to an off-by-default toggle. The |
@jdalton what's |
might be premature to hook in to Node's oh, this PR needs to be retargeted to |
I think this probably needs to land after v6... I don't think I have time to give it the attention it deserves rn |
apparently deleting the target branch closes the issue. |
The
Will re-open under master. Update: Ok @boneskull, retargeted. Is it possible to just re-open this PR? |
doesn’t look like it. |
No worries. Re-opened as #3703. |
This PR adds zero-config support for loading ES modules in Node. This PR just replaces the entry
require
withesmRequire
. Now--require
modules, configs, and others files can have ESM syntax. The caveat is that.mjs
files are not supported since under the hood mocha is still usingrequire()
to load files. See the followingesm
doc note:@boneskull Feel free to push tests to this PR.