Skip to content

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

Closed
Kræn Hansen (kraenhansen) wants to merge 6 commits into
microsoft:mainfrom
kraenhansen:fix-54573
Closed

Kræn Hansen (kraenhansen) wants to merge 6 commits into
microsoft:mainfrom
kraenhansen:fix-54573

Conversation

@kraenhansen

Copy link
Copy Markdown

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 (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jun 8, 2023
@kraenhansen

Copy link
Copy Markdown
Author

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

@RyanCavanaugh

Copy link
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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