Skip to content

Commit 66028f7

Browse files
committed
fix list emitted file with emitDeclarationOnly options
1 parent af8e44a commit 66028f7

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

src/compiler/emitter.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,24 +134,26 @@ namespace ts {
134134
emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath);
135135

136136
if (!emitSkipped && emittedFilesList) {
137-
if (!emitOnlyDtsFiles) {
138-
emittedFilesList.push(jsFilePath);
139-
}
140-
if (sourceMapFilePath) {
141-
emittedFilesList.push(sourceMapFilePath);
137+
if (!compilerOptions.emitDeclarationOnly) {
138+
if (!emitOnlyDtsFiles) {
139+
emittedFilesList.push(jsFilePath);
140+
}
141+
if (sourceMapFilePath) {
142+
emittedFilesList.push(sourceMapFilePath);
143+
}
144+
if (bundleInfoPath) {
145+
emittedFilesList.push(bundleInfoPath);
146+
}
142147
}
143148
if (declarationFilePath) {
144149
emittedFilesList.push(declarationFilePath);
145150
}
146-
if (bundleInfoPath) {
147-
emittedFilesList.push(bundleInfoPath);
148-
}
149151
}
150152
}
151153

152154
function emitJsFileOrBundle(sourceFileOrBundle: SourceFile | Bundle, jsFilePath: string, sourceMapFilePath: string | undefined, bundleInfoPath: string | undefined) {
153155
// Make sure not to write js file and source map file if any of them cannot be written
154-
if (host.isEmitBlocked(jsFilePath) || compilerOptions.noEmit || compilerOptions.emitDeclarationOnly) {
156+
if (host.isEmitBlocked(jsFilePath) || compilerOptions.noEmit) {
155157
emitSkipped = true;
156158
return;
157159
}

0 commit comments

Comments
 (0)