NodeNext

A module and moduleResolution setting that makes TypeScript follow exactly the module rules of current Node.js.

In more detail

It honours package.json exports and imports fields and requires explicit file extensions in relative imports, such as ./user.js. This prevents code that type-checks but fails to load at run time. Use it for code run directly by Node.js; use bundler resolution for code built by a bundler.

Example

"module": "NodeNext", "moduleResolution": "NodeNext"

Related terms

Taught in

References