-
I have the following settings in tsconfig:
My library is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
ts-node supports all module modes, including the new For you, I recommend using new new To understand better what's going on, I recommend starting here: If you choose not to use NodeNext, your project will still work! But remember that package.json "type" will be important no matter what mode you choose. Remember, node's ESM support still has rough edges, so care must be taken in project configuration. |
Beta Was this translation helpful? Give feedback.
ts-node supports all module modes, including the new
NodeNext
. I suspect you forgot to set "type" in your package.jsonFor you, I recommend using new new
NodeNext
mode.To understand better what's going on, I recommend starting here:
https://typestrong.org/ts-node/docs/imports
And to learn about NodeNext, start here:
https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#esm-nodejs
If you choose not to use NodeNext, your project will still work! But remember that package.json "type" will be important no matter what mode you choose.
Remember, node's ESM support still has rough edges, so care must be taken in project configuration.