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

feat: support TS directory imports for ESM #422

Merged
merged 1 commit into from May 20, 2022

Conversation

mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented May 20, 2022

Support ESM module resolution for typescript directories

Fixes #421

@mdonnalley mdonnalley self-assigned this May 20, 2022
@@ -13,7 +13,7 @@ const getPackageType = require('get-package-type')
* Defines file extension resolution when source files do not have an extension.
*/
// eslint-disable-next-line camelcase
const s_EXTENSIONS: string[] = ['.js', '.mjs', '.cjs']
const s_EXTENSIONS: string[] = ['.ts', '.js', '.mjs', '.cjs']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should .jsx or .tsx file extensions be included?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peternhale aren't .jsx and .tsx files specific to react development?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Anything in oclif that prevents one from using react?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peternhale I just don't see the use case for using jsx syntax in a CLI. I'd rather not support it until someone comes along with a convincing use case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely want to play around with https://github.com/vadimdemedes/ink at some point. Might add it then 😄

@mdonnalley mdonnalley merged commit 4c58e78 into main May 20, 2022
@mdonnalley mdonnalley deleted the mdonnalley/esm-ts-module-resolution branch May 20, 2022 17:16
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

Successfully merging this pull request may close these issues.

Can't use typescript commands with ESM modules
3 participants