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

Adding an outExtension option to control the file extension of emitted files #54583

Closed
wants to merge 6 commits into from

Conversation

kraenhansen
Copy link

Fixes #54573 by adding a new outExtension option to control the extension of the emitted files (except .tsx, .jsx and .json input files which won't be affected by the outExtension option):

  • "input" (default): Infers the extension of out files from the extension of the input file. This is the behaviour prior to this PR and I've added it to limit the intrusiveness of the fix.
  • "module": Infers the extension of out files from the module option, if "commonjs" the out files will use .cjs, if any "es6" through "esnext" the out files will use .mjs and .js will be used for any other case.
  • "cjs": Use .cjs for all out files.
  • "mjs": Use .mjs for all out files.
  • "js": Use .js for all out files.

Note: I'm drafting the PR until the associated issue in the Backlog milestone.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jun 8, 2023
@kraenhansen
Copy link
Author

@microsoft-github-policy-service agree company="MongoDB"

@RyanCavanaugh
Copy link
Member

I'm closing for clarity because the PR is not implementing the behavior approved in the linked issue (no wrongdoing implied by this statement, since the comment postdates the PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using "allowJs": true and "module": "commonjs" to transform .mjs files should emit .cjs files
3 participants