egoist / bili

Bili makes it easier to bundle JavaScript libraries.

Home Page:https://bili.egoist.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

renoirb opened this issue · comments

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.