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

Need clarifications: Warns when fileName extension is .mjs for ESM and Node.js v14 #435

Open
renoirb opened this issue Aug 5, 2020 · 0 comments

Comments

@renoirb
Copy link
Contributor

renoirb commented Aug 5, 2020

Following up with #160

Node.js v14 (soon to be LTS) will (should?) ship with ESM modules without being under flag, but will only when file name ends by .mjs.

import {foo} from ‘./file.mjs’
// ...

We can still call the file any name we want, Bili warns that it’s best not to use that file extension.

I realize that this warning is triggered because package.json main has file name ending .mjs. New Node should let us use exports instead.

But, Node.js will soon ship with ESM without being behind flag, It’s coming soon. It’s a a matter of finishing a few issues, (TODO: find ticket in Node.js project).

Are there plans to remove the warning if the target is Node.js v14.

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

No branches or pull requests

1 participant