Skip to content

esm: replace --entry-type with --input-type

This is a change discussed and approved by the modules working group per our meeting today on 2019-04-10. We’re hoping that this change can be merged in before the release of Node 12.

Per https://github.com/nodejs/modules/issues/300#issuecomment-477728981, this PR replaces --entry-type with --input-type, a flag just like --entry-type but only for --eval, --print and STDIN.

This way we still provide a way to use ESM in those non-file inputs, but we’re removing the footgun that is --entry-type in its current form. To use ESM in files, the files need to end in .mjs or be in a "type": "module" package scope.

Tests and docs updated.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading