MCPcopy
hub / github.com/prisma/prisma / createBuildOptions

Function createBuildOptions

helpers/compile/build.ts:70–78  ·  view source on GitHub ↗

* Create two deferred builds for esm and cjs. The one follows the other: * - 1. The code gets compiled to an optimized tree-shaken esm output * - 2. We take that output and compile it to an optimized cjs output * @param options the original build options * @returns if options = [a, b], we get [a

(options: BuildOptions[])

Source from the content-addressed store, hash-verified

68 * @returns if options = [a, b], we get [a-esm, a-cjs, b-esm, b-cjs]
69 */
70function createBuildOptions(options: BuildOptions[]) {
71 return flatten(
72 map(options, (options) => [
73 // we defer it so that we don't trigger glob immediately
74 () => applyDefaults(options),
75 // ... here can go more steps
76 ]),
77 )
78}
79
80/**
81 * We only want to trigger the glob search once we are ready, and that is when

Callers 1

buildFunction · 0.85

Calls 3

flattenFunction · 0.90
mapFunction · 0.85
applyDefaultsFunction · 0.85

Tested by

no test coverage detected