Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path mapping resolution support? #294

Closed
Axure opened this issue Mar 24, 2017 · 4 comments
Closed

Path mapping resolution support? #294

Axure opened this issue Mar 24, 2017 · 4 comments

Comments

@Axure
Copy link

Axure commented Mar 24, 2017

According to these issues:

The TS team has said that they won't change this, since making such code running is non of their business. So what is ts-node's attitude towards this?

@Jontem
Copy link
Contributor

Jontem commented Mar 24, 2017

As i understand it ts-node will not support this because it isn't how node works. This topic has been discussed before in these issues #219 and #138.

Out of that came the tsconfig-paths package that acts as a plugin that you can use with ts-node to use path mappings with node.

@blakeembrey
Copy link
Member

I personally don't have any desire to implement this in ts-node. It'd deviate from exactly what TypeScript is saying - this isn't something native in node or something TypeScript does, so ts-node shouldn't be doing it. I'd recommend using a plugin like tsconfig-paths which @Jontem mentioned above. I don't really want this module doing anything magical, it should just be a layer for doing it's job - running TypeScript on node as though you'd done tsc && node. I'd be happy to take a PR adding that module to the README though, but note that using path mapping means it'll make your project less portable.

@jonaskello
Copy link
Contributor

@blakeembrey I did a PR adding tsconfig-paths information to the readme in #295.

@joonhocho
Copy link

I've created a compile-time solution. https://github.com/joonhocho/tscpaths

microsoft/TypeScript#15479 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants