nodejs / modules

Node.js Modules Team

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Mixed module types within app/module; gradual migration from CommonJS to ESM

GeoffreyBooth opened this issue · comments

I have a large application or module and want to be able to gradually migrate from CommonJS to ESM, one file at a time, without needing to refactor the entire codebase all at once.

So ESM-syntax files could import CommonJS files and CommonJS files could require ESM files, within the same app or module.

Use cases 8, 39.

Note: This was meant to go along with the feature in the features doc called “bidirectional interoperability” but it seems to also cover “per-module mode” (and has the same use cases) so I think it’s just one feature. Happy to amend if I’m missing something.