MCPcopy Index your code
hub / github.com/stenciljs/core / taskPrerender

Function taskPrerender

src/cli/task-prerender.ts:7–25  ·  view source on GitHub ↗
(coreCompiler: CoreCompiler, config: ValidatedConfig)

Source from the content-addressed store, hash-verified

5import { startupCompilerLog } from './logs';
6
7export const taskPrerender = async (coreCompiler: CoreCompiler, config: ValidatedConfig) => {
8 startupCompilerLog(coreCompiler, config);
9
10 const hydrateAppFilePath = config.flags.unknownArgs[0];
11
12 if (typeof hydrateAppFilePath !== 'string') {
13 config.logger.error(`Missing hydrate app script path`);
14 return config.sys.exit(1);
15 }
16
17 const srcIndexHtmlPath = config.srcIndexHtml;
18
19 const diagnostics = await runPrerenderTask(coreCompiler, config, hydrateAppFilePath, undefined, srcIndexHtmlPath);
20 config.logger.printDiagnostics(diagnostics);
21
22 if (diagnostics.some((d) => d.level === 'error')) {
23 return config.sys.exit(1);
24 }
25};
26
27export const runPrerenderTask = async (
28 coreCompiler: CoreCompiler,

Callers 1

runTaskFunction · 0.90

Calls 5

startupCompilerLogFunction · 0.90
runPrerenderTaskFunction · 0.85
errorMethod · 0.80
exitMethod · 0.80
printDiagnosticsMethod · 0.80

Tested by

no test coverage detected