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: .cjs/mjs extension support and dot named files #30

Merged

Conversation

jason-ha
Copy link
Contributor

  1. Detect source .cjs and .mjs files and extend to those.
  2. When extension is not empty, if not one of known js extensions and file does not exist, try to find fix up source path.

Also alter convert loop to have two general cases: first just adding extension, then trying with /index + those extensions. And sort extensions to test for more commonly expected cases first for efficiency.

Fixes #29

1. Detect source .cjs and .mjs files and extend to those.
2. When extension is not empty, if not one of known js extensions and file does not exist, try to find fix up source path.

Also alter convert loop to have two general cases: first just adding extension, then trying with /index + those extensions. And sort extensions to test for more commonly expected cases first for efficiency.
@bennycode bennycode merged commit f8cf9b6 into bennycode:main Jan 14, 2024
2 checks passed
@bennycode
Copy link
Owner

Thanks for your contribution! I released it with v1.3.0 ✌️

@jason-ha jason-ha deleted the dot-named-file-and-cjs-mjs-support branch January 16, 2024 18:21
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.

ts2esm does not support files of type `file_name.some_extension.ts'
2 participants