MCPcopy Create free account
hub / github.com/vercel/vercel / executeBuild

Function executeBuild

packages/cli/src/util/dev/builder.ts:219–530  ·  view source on GitHub ↗
(
  vercelConfig: VercelConfig,
  devServer: DevServer,
  files: BuilderInputs,
  match: BuildMatch,
  requestPath: string | null,
  isInitialBuild: boolean,
  filesChanged?: string[],
  filesRemoved?: string[]
)

Source from the content-addressed store, hash-verified

217}
218
219export async function executeBuild(
220 vercelConfig: VercelConfig,
221 devServer: DevServer,
222 files: BuilderInputs,
223 match: BuildMatch,
224 requestPath: string | null,
225 isInitialBuild: boolean,
226 filesChanged?: string[],
227 filesRemoved?: string[]
228): Promise<void> {
229 const {
230 builderWithPkg: { path: requirePath, builder, pkg },
231 } = match;
232 const { entrypoint, use } = match;
233 const isStatic = isStaticRuntime(use);
234 const { envConfigs, cwd: workPath, devCacheDir } = devServer;
235 const debug = output.isDebugEnabled();
236
237 const startTime = Date.now();
238 const showBuildTimestamp = !isStatic && (!isInitialBuild || debug);
239
240 if (showBuildTimestamp) {
241 output.log(`Building ${use}:${entrypoint}`);
242 output.debug(
243 `Using \`${pkg.name}${pkg.version ? `@${pkg.version}` : ''}\``
244 );
245 }
246
247 const config = match.config || {};
248
249 let result: BuildResult;
250
251 let { buildProcess } = match;
252 if (!isStatic && !buildProcess) {
253 buildProcess = await createBuildProcess(match, envConfigs, workPath);
254 }
255
256 const serviceRoutePrefix = config.routePrefix;
257 const serviceWorkspace = config.workspace;
258 const buildOptions: BuildOptions = {
259 files,
260 entrypoint,
261 workPath,
262 repoRootPath: workPath,
263 config,
264 meta: {
265 isDev: true,
266 requestPath,
267 devCacheDir,
268 filesChanged,
269 filesRemoved,
270 // This env distiniction is only necessary to maintain
271 // backwards compatibility with the `@vercel/next` builder.
272 env: { ...envConfigs.runEnv },
273 buildEnv: { ...envConfigs.buildEnv },
274 },
275 ...(typeof serviceRoutePrefix === 'string' ||
276 typeof serviceWorkspace === 'string'

Callers 3

updateBuildMatchesMethod · 0.90
_startMethod · 0.90
triggerBuildMethod · 0.90

Calls 15

isStaticRuntimeFunction · 0.90
getTitleNameFunction · 0.90
normalizeRoutesFunction · 0.90
normalizePathFunction · 0.90
createBuildProcessFunction · 0.85
getUpdateCommandFunction · 0.85
deserializeBuildOutputsFunction · 0.85
debugMethod · 0.80
createZipMethod · 0.80
buildMethod · 0.65
pushMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected