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

Function esbuildBundleOf

ark/aot/unplugin.ts:3224–3237  ·  view source on GitHub ↗
(metafile: Metafile, cwd: string)

Source from the content-addressed store, hash-verified

3222}
3223
3224const esbuildBundleOf = (metafile: Metafile, cwd: string): BundleModules => ({
3225 externals: Object.values(metafile.outputs).flatMap(
3226 output =>
3227 output.imports?.flatMap(entry => (entry.external ? entry.path : [])) ?? []
3228 ),
3229 files: Object.keys(metafile.inputs).map(path => resolve(cwd, path)),
3230 importerOf: Object.fromEntries(
3231 Object.entries(metafile.inputs).flatMap(([path, { imports }]) =>
3232 imports.flatMap(entry =>
3233 entry.external ? [[entry.path, resolve(cwd, path)]] : []
3234 )
3235 )
3236 )
3237})
3238
3239// an external the runtime can't share: arktype as an entry, or a package the
3240// bundle holds a copy of too

Callers 1

checkEsbuildBundleFunction · 0.85

Calls 2

resolveFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected