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

Function buildTemplate

packages/next/scripts/build-edge-function-template.js:8–24  ·  view source on GitHub ↗

* @param {Pick } options

(options)

Source from the content-addressed store, hash-verified

6 * @param {Pick<import('esbuild').BuildOptions, 'outfile' | 'format' | 'entryPoints' | 'write'>} options
7 */
8async function buildTemplate(options) {
9 return build({
10 bundle: true,
11 entryPoints: options.entryPoints,
12 format: options.format,
13 legalComments: 'none',
14 minify: process.env.NODE_ENV !== 'test',
15 outfile: options.outfile,
16 // Cloudflare Workers uses the V8 JavaScript engine from Google Chrome.
17 // The Workers runtime is updated at least once a week, to at least the version
18 // that is currently used by Chrome's stable release.
19 // To see the latest stable chrome version: https://www.chromestatus.com/features/schedule
20 target: 'esnext',
21 write: options.write,
22 external: ['async_hooks'], // available in edge runtime
23 });
24}
25
26async function buildNextjsWrapper() {
27 const { outputFiles } = await buildTemplate({

Callers 1

buildNextjsWrapperFunction · 0.85

Calls 1

buildFunction · 0.50

Tested by

no test coverage detected