Native ESM support, possibly requiring integration with ts-node
See original GitHub issueIn ts-node
we released experimental support for native ECMAScript modules. To do this we needed to implement a custom resolve()
loader hook. It is a copy-paste of node’s built-in resolver, tweaked for our needs.
https://github.com/TypeStrong/ts-node/issues/1007
Is native ESM support on your radar? Do you have thoughts on how best to implement it for tsconfig-paths? I expect we will need to coordinate, since node only supports a single loader hook.
I see that the compiler itself can perform these resolutions via ts.resolveModuleName
. Do you use that internally, or do you do something else?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:26
- Comments:8
Top Results From Across the Web
Documentation - ECMAScript Modules in Node.js - TypeScript
Interoperating between the two module systems brings large challenges, with many new features to juggle; however, support for ESM in Node.js is now...
Read more >ts-node - npm
This error is thrown by node when a module is require() d, but node believes it should execute as native ESM. This can...
Read more >What does it take to support Node.js ESM? – The Guild
I have worked on all The Guild's libraries and graphql-js to support ESM. Here is how you can do it too.
Read more >CommonJS vs native ECMAScript modules | ts-node
ts -node's ESM support is as stable as possible, but it relies on APIs which node can and will break in new versions...
Read more >Node v13 / Jest / ES6 — native support for modules without ...
Yes, it is possible from jest@25.4.0 . From this version, there is a native support of esm, so you will not have to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wanted to mention new solution created by @charles-allen 4 days ago (https://github.com/TypeStrong/ts-node/discussions/1450#discussioncomment-1806115)
Closing in favor of https://github.com/TypeStrong/ts-node/pull/1585 which will add native path mapping support to ts-node.