Handle when no .tsbuildinfo is to be generated
This commit is contained in:
parent
99df3230aa
commit
1d77008993
|
@ -48,7 +48,7 @@ namespace ts {
|
|||
}
|
||||
if (includeBuildInfo) {
|
||||
const buildInfoPath = getOutputPathForBuildInfo(host.getCompilerOptions(), host.getProjectReferences());
|
||||
return action({ buildInfoPath }, /*sourceFileOrBundle*/ undefined);
|
||||
if (buildInfoPath) return action({ buildInfoPath }, /*sourceFileOrBundle*/ undefined);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1487,7 +1487,10 @@ namespace ts {
|
|||
for (const inputFile of project.fileNames) {
|
||||
outputs.push(...getOutputFileNames(inputFile, project));
|
||||
}
|
||||
if (!ignoreBuildInfo) outputs.push(Debug.assertDefined(getOutputPathForBuildInfo(project.options, project.projectReferences)));
|
||||
if (!ignoreBuildInfo) {
|
||||
const buildInfoPath = getOutputPathForBuildInfo(project.options, project.projectReferences);
|
||||
if (buildInfoPath) outputs.push(buildInfoPath);
|
||||
}
|
||||
return outputs;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,22 @@ namespace ts {
|
|||
assert(fs.existsSync(output), `Expect file ${output} to exist`);
|
||||
}
|
||||
});
|
||||
|
||||
it("builds correctly when project is not composite or doesnt have any references", () => {
|
||||
const fs = projFs.shadow();
|
||||
replaceText(fs, "/src/core/tsconfig.json", `"composite": true,`, "");
|
||||
const host = new fakes.SolutionBuilderHost(fs);
|
||||
const builder = createSolutionBuilder(host, ["/src/core"], { verbose: true });
|
||||
builder.buildAllProjects();
|
||||
host.assertDiagnosticMessages(
|
||||
getExpectedDiagnosticForProjectsInBuild("src/core/tsconfig.json"),
|
||||
[Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, "src/core/tsconfig.json", "src/core/anotherModule.js"],
|
||||
[Diagnostics.Building_project_0, "/src/core/tsconfig.json"]
|
||||
);
|
||||
for (const output of ["/src/core/index.js", "/src/core/index.d.ts", "/src/core/index.d.ts.map"]) {
|
||||
assert(fs.existsSync(output), `Expect file ${output} to exist`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("dry builds", () => {
|
||||
|
|
Loading…
Reference in a new issue