MCPcopy Create free account
hub / github.com/arktypeio/arktype / bundle

Function bundle

ark/repo/bench/bundle.ts:104–132  ·  view source on GitHub ↗
(
	scenario: SizedScenario,
	library: SizedLibrary
)

Source from the content-addressed store, hash-verified

102
103// a scenario's exports, plus usageEntries for libraries whose schemas have no methods
104export const bundle = async (
105 scenario: SizedScenario,
106 library: SizedLibrary
107): Promise<Bundle> => {
108 const { outputFiles, metafile } = await build({
109 stdin: {
110 contents: await entry(scenario, library),
111 resolveDir: apps,
112 loader: "ts"
113 },
114 bundle: true,
115 minify: true,
116 format: "esm",
117 platform: "neutral",
118 write: false,
119 metafile: true,
120 logLevel: "error",
121 conditions: ["production"],
122 plugins:
123 library === "standalone" ?
124 [precompile.esbuild({ cwd: apps, ...standaloneOptions })]
125 : library === "standaloneFirst" ?
126 [precompile.esbuild({ cwd: apps, errors: "first" })]
127 : library === "standaloneSmallest" ?
128 [precompile.esbuild({ cwd: apps, preset: "smallest" })]
129 : []
130 })
131 return { js: outputFiles[0].text, metafile }
132}

Callers 2

import.tsFile · 0.90
size.tsFile · 0.90

Calls 2

entryFunction · 0.70
buildFunction · 0.50

Tested by

no test coverage detected