Skip to content

fix list emitted file with emitDeclarationOnly options - #27045

Closed
Wenlu Wang (Kingwl) wants to merge 4 commits into
microsoft:masterfrom
Kingwl:fix_list_emitted_file
Closed

fix list emitted file with emitDeclarationOnly options#27045
Wenlu Wang (Kingwl) wants to merge 4 commits into
microsoft:masterfrom
Kingwl:fix_list_emitted_file

Conversation

@Kingwl

Copy link
Copy Markdown
Contributor

Fixes #27009

have no test🤷🏻‍♂️

Comment thread src/compiler/emitter.ts Outdated
emittedFilesList.push(bundleInfoPath);
}
}
else if (emittedFilesList && compilerOptions.emitDeclarationOnly && declarationFilePath) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't this this is right fix. We should set emitSkipped correctly instead (because emitDeclarationOnly does not skip emit by emitting only .d.ts)

@Kingwl

Copy link
Copy Markdown
Contributor Author

i'm not sure change the order of the list is correct

Comment thread src/compiler/emitter.ts
}
if (declarationFilePath) {
emittedFilesList.push(declarationFilePath);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you. This looks good. While you are at it can you please also add

if(declarationMapPath) {
    emittedFilesList.push(declarationMapPath);
}

const fs = projFs.shadow();
const host = new fakes.SolutionBuilderHost(fs);
const builder = createSolutionBuilder(host, ["/src/tests"], { listEmittedFiles: true, declaration: true, emitDeclarationOnly: true });
builder.buildAllProjects();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think you also need to update this and test case above to include anotherModule.d.ts.map, index.d.ts.map

@sheetalkamat

Copy link
Copy Markdown
Member

Closing this in favor of #27715 which inline with what we would want to do if we want to skip js emit for some files.

@Kingwl
Wenlu Wang (Kingwl) deleted the fix_list_emitted_file branch October 12, 2018 01:22
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants