Adding an outExtension
option to control the file extension of emitted files
#54583
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theoutExtension
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 themodule
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.