MCPcopy Index your code
hub / github.com/nodejs/node / emitBundle

Function emitBundle

test/fixtures/snapshot/typescript.js:124717–124752  ·  view source on GitHub ↗
(writeFileCallback, customTransformers)

Source from the content-addressed store, hash-verified

124715 return emitDiagnostics;
124716 }
124717 function emitBundle(writeFileCallback, customTransformers) {
124718 var _a, _b;
124719 ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle);
124720 if (state.options.dry) {
124721 reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project);
124722 buildResult = BuildResultFlags.Success;
124723 step = BuildStep.QueueReferencingProjects;
124724 return undefined;
124725 }
124726 if (state.options.verbose)
124727 reportStatus(state, ts.Diagnostics.Updating_output_of_project_0, project);
124728 // Update js, and source map
124729 var compilerHost = state.compilerHost;
124730 state.projectCompilerOptions = config.options;
124731 var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) {
124732 var refName = resolveProjectName(state, ref.path);
124733 return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName));
124734 }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project)));
124735 if (ts.isString(outputFiles)) {
124736 reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles));
124737 step = BuildStep.BuildInvalidatedProjectOfBundle;
124738 return invalidatedProjectOfBundle = createBuildOrUpdateInvalidedProject(InvalidatedProjectKind.Build, state, project, projectPath, projectIndex, config, buildOrder);
124739 }
124740 // Actual Emit
124741 ts.Debug.assert(!!outputFiles.length);
124742 var emitterDiagnostics = ts.createDiagnosticCollection();
124743 var emittedOutputs = new ts.Map();
124744 outputFiles.forEach(function (_a) {
124745 var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
124746 emittedOutputs.set(toPath(state, name), name);
124747 ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
124748 });
124749 var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, minimumDate,
124750 /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ false, outputFiles[0].name, BuildResultFlags.DeclarationOutputUnchanged);
124751 return { emitSkipped: false, diagnostics: emitDiagnostics };
124752 }
124753 function executeSteps(till, cancellationToken, writeFile, customTransformers) {
124754 while (step <= till && step < BuildStep.Done) {
124755 var currentStep = step;

Callers 2

executeStepsFunction · 0.85

Calls 13

reportStatusFunction · 0.85
resolveProjectNameFunction · 0.85
parseConfigFileFunction · 0.85
toResolvedConfigFilePathFunction · 0.85
relNameFunction · 0.85
toPathFunction · 0.85
finishEmitFunction · 0.85
assertMethod · 0.80
forEachMethod · 0.65
callMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…