-
Notifications
You must be signed in to change notification settings - Fork 12.8k
.d.ts files don't have outputs #25368
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
Conversation
@@ -295,7 +295,8 @@ namespace ts { | |||
} | |||
|
|||
function getOutputFileNames(inputFileName: string, configFile: ParsedCommandLine): ReadonlyArray<string> { | |||
if (configFile.options.outFile) { | |||
// outFile is handled elsewhere; .d.ts files don't generate outputs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And neither do .json
if the allow json files flag is on, I believe?
src/compiler/tsbuild.ts
Outdated
function getOutputFileNames(inputFileName: string, configFile: ParsedCommandLine): ReadonlyArray<string> { | ||
if (configFile.options.outFile) { | ||
// outFile is handled elsewhere; .d.ts files don't generate outputs | ||
if (configFile.options.outFile || fileExtensionIsOneOf(inputFileName, extensionsWithNoOutput)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options.out
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also what about --noEmit
?
src/compiler/tsbuild.ts
Outdated
function getOutputFileNames(inputFileName: string, configFile: ParsedCommandLine): ReadonlyArray<string> { | ||
if (configFile.options.outFile) { | ||
// outFile is handled elsewhere; .d.ts files don't generate outputs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Json files are emitted just like js files. But they do not have sourcemaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really? So if I require
/import
my package.json it'll bet included in the emit? o.O
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Count me as surprised as well, but verified and this is the case
Interesting note: I had missed the |
Fixes #25355