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(esm): support custom conditions #675

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

colinlienard
Copy link

Add support for customConditions in ESM.

For example, if a tsconfig contains this:

{
	"compilerOptions": {
		"customConditions": ["source"],
	}
}

passing the condition as an arg to the CLI would not be needed anymore:

- tsx --conditions source src
+ tsx src

But this is only for ESM as explained here: #574 (comment)

Related to #574

@privatenumber
Copy link
Owner

Thanks for the PR

This is blocked until we add condition support to the CJS resolver though. Since tsx aims to consolidate ESM and CJS, we want to avoid introducing discrepancies between them.

@colinlienard
Copy link
Author

I tried adding support for CJS, but it seems quite challenging. Do you have any ideas on how to make it work? @privatenumber

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.

2 participants