Skip to content

should support TS, TSX, JS, JSX in same directory #173

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

Closed
mavericken opened this issue Oct 31, 2016 · 2 comments
Closed

should support TS, TSX, JS, JSX in same directory #173

mavericken opened this issue Oct 31, 2016 · 2 comments

Comments

@mavericken
Copy link
Contributor

Currently plugin-typescript can only handle one file extension per directory via SystemJS's default extension configuration. The typescript compiler, on the other hand, will try multiple extensions until it finds the file. I feel that plugin-typescript's capabilities should match the capabilities of the standard typescript compiler, so we should also check for other extensions when we fail to find the file.

I have made a pull request that can do what I am proposing: #172

@mavericken
Copy link
Contributor Author

mavericken commented Oct 31, 2016

My solution was helpful, but after using it this afternoon I found it to be incomplete, so I closed the pull request. Nonetheless I think the issue is still valid.

Edit: I made some improvements and made a new pull request: #176
It provides a configurable way to fall back to other file extensions if the one attempted is not resolvable. So you can add the option fileExtensions: ["ts","tsx"], and if you ask it for filename.ts, and it does not exist, but filename.tsx exists, it will grab filename.tsx. This way you can have both file types in a single directory, like with the normal typescript compiler.

@mavericken
Copy link
Contributor Author

I made a separate module which will take care of this, which can be used in conjunction with plugin-typescript.
https://www.npmjs.com/package/one-plugin

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

1 participant