Skip to content

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