Skip to content

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

@renoirb

Description

@renoirb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions