Skip to content

.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

Merged
merged 4 commits into from
Jul 2, 2018
Merged

Conversation

RyanCavanaugh
Copy link
Member

Fixes #25355

@@ -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
Copy link
Member

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?

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)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options.out as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also what about --noEmit?

function getOutputFileNames(inputFileName: string, configFile: ParsedCommandLine): ReadonlyArray<string> {
if (configFile.options.outFile) {
// outFile is handled elsewhere; .d.ts files don't generate outputs
Copy link
Member

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.

Copy link
Member

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

Copy link
Member Author

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

@RyanCavanaugh RyanCavanaugh merged commit c58e298 into microsoft:master Jul 2, 2018
@RyanCavanaugh RyanCavanaugh deleted the fix25355 branch July 2, 2018 22:37
@StevenLangbroek
Copy link

Interesting note: I had missed the esModuleInterop param from the announcement, and adding it actually made json imports work for me. Is that expected? (2.9.1)

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.

5 participants