You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've assigned this to @alvis and added it to our next milestone. Let us know if you need any guidance to implement the necessary changes. I've added some notes below.
At a minimum, you'll need to add require.extensions hooks for mts, mjs, cts, and cjs extensions. You may also need to add them to the extensions passed to createResolve:
Should the new extensions be enabled conditionally, only when your TS version is >= 4.5?
I don't expect you'll need to implement any fancy resolving logic beyond that. TS already handles resolving within the typechecker, and node's existing resolution logic should continue to behave.
@PodaruDragos you're probably looking for node's --experimental-specifier-resolution=node which we already support. Just as node requires you to pass that flag, we also require you to pass that flag, often via the NODE_OPTIONS environment variable.
Activity
alvis commentedon Oct 17, 2021
With 4.5 beta announced 2 weeks ago, and the final on the horizon, time for us to do something.
cspotcode commentedon Oct 17, 2021
@alvis are you referring to a pull request that you have submitted?
cspotcode commentedon Oct 18, 2021
I've assigned this to @alvis and added it to our next milestone. Let us know if you need any guidance to implement the necessary changes. I've added some notes below.
At a minimum, you'll need to add
require.extensionshooks formts,mjs,cts, andcjsextensions. You may also need to add them to the extensions passed tocreateResolve:ts-node/src/esm.ts
Lines 50 to 54 in 3b40365
ts-node/src/index.ts
Lines 482 to 491 in 3b40365
Should the new extensions be enabled conditionally, only when your TS version is >= 4.5?
I don't expect you'll need to implement any fancy resolving logic beyond that. TS already handles resolving within the typechecker, and node's existing resolution logic should continue to behave.
PodaruDragos commentedon Dec 11, 2021
Will this mean that we can now potentially have
import { foo } from './foo', basically omitting the extensions just like incommonJS?cspotcode commentedon Dec 11, 2021
@PodaruDragos you're probably looking for node's
--experimental-specifier-resolution=nodewhich we already support. Just as node requires you to pass that flag, we also require you to pass that flag, often via theNODE_OPTIONSenvironment variable.https://nodejs.org/dist/latest-v17.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm
Add the ability to run TypeScript files from CLI
Add the ability to run TypeScript files from CLI
Add the ability to run TypeScript files from CLI
Update dependency ts-node to v10.8.0 (#1367)