( vercelConfig: VercelConfig, devServer: DevServer, files: BuilderInputs, match: BuildMatch, requestPath: string | null, isInitialBuild: boolean, filesChanged?: string[], filesRemoved?: string[] )
| 217 | } |
| 218 | |
| 219 | export 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' |
no test coverage detected