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

Typescript paths support #248

Closed
gleba opened this issue Jun 12, 2018 · 2 comments
Closed

Typescript paths support #248

gleba opened this issue Jun 12, 2018 · 2 comments

Comments

@gleba
Copy link

gleba commented Jun 12, 2018

What about typescript module resolution?
Something like as https://www.npmjs.com/package/tsconfig-paths
?

@alangpierce
Copy link
Owner

@gleba It looks to me like you should be able to use tsconfig-paths and tsconfig-paths-webpack-plugin alongside Sucrase. Sucrase just does the code transformation step, and those two projects modify the path resolution behavior without transforming the code. Sucrase looks at files isolation without reading the filesystem, and doesn't care about or modify the string used in import statements, so any module resolution details should just work as long as they don't rely on code transformation.

There's some other discussion about using Sucrase to rewrite import statements here: #161 (comment) . Is that the sort of thing you were referring to?

@alangpierce
Copy link
Owner

Closing since I think I want to call filesystem-based path resolution out of scope for Sucrase (similar to how it's out of scope for tsc). Feel free to comment or file a new issue if you have a strong need for it.

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