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

Feature: supporting tsconfig.json "paths" mapping #2

Closed
printjs opened this issue May 31, 2018 · 8 comments
Closed

Feature: supporting tsconfig.json "paths" mapping #2

printjs opened this issue May 31, 2018 · 8 comments

Comments

@printjs
Copy link

printjs commented May 31, 2018

image
image

@printjs
Copy link
Author

printjs commented May 31, 2018

@AviVahl

@printjs
Copy link
Author

printjs commented May 31, 2018

#1

@AviVahl
Copy link
Owner

AviVahl commented May 31, 2018

Thanks for the report. First one! :)

If you also register https://www.npmjs.com/package/tsconfig-paths

Does it work?

@AviVahl
Copy link
Owner

AviVahl commented May 31, 2018

I'll also think about built-in support without the additional overhead...

@printjs
Copy link
Author

printjs commented May 31, 2018

Yes,I always use ts-node and tsconfig-paths.This combination works very well.Expecting to become a built-in.Your project is very good.I like it.

@AviVahl AviVahl mentioned this issue Jun 1, 2018
@AviVahl AviVahl changed the title Sorry,this lib can't support path map Feature: supporting tsconfig.json "paths" mapping Jun 1, 2018
@AviVahl
Copy link
Owner

AviVahl commented Jun 1, 2018

Just to clarify the current status:

node-typescript-support does not apply any additional processing of the sources (other than transpilation), and thus generated code that relies on mapped "paths" will fail at runtime.

It should be noted that type checking still works (or supposed to work) and report proper type errors, even for types coming out of mapped locations. The generated JS code does not have the paths mapped and fails on Node when running it as-is.

Using node-typescript-support with tsconfig.paths should be possible as well (like using that project with ts-node. You would need to register both.

Built-in support for paths is being considered. If tsconfig.paths works for now, it is on a lower priority than other features or refactors.

@AviVahl
Copy link
Owner

AviVahl commented Oct 26, 2018

Fixed in master and will be fixed in the upcoming release of @ts-tools/node.

@AviVahl
Copy link
Owner

AviVahl commented Nov 2, 2018

@printjs baseUrl and paths are now supported in @ts-tools/node@0.7.0. No need for additional external packages.

AviVahl added a commit that referenced this issue Feb 17, 2019
- users can now control type checking and config lookup separately. closes #2.
- users can search and parse configuration files, which will be preloaded in the service. closes #3.
- simpilified `createHost`/`createLanguageServiceHost` flow when using custom file systems.
- `cwd` can now be provided by customizing base host's `getCurrentDirectory`.
- package should now be truely isomorphic (not tested yet). never assumes ts.sys is available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants