// fixtures/colophon-inputs.mjs — prints, as JSON, every input file // esbuild reads to build the shipped bundles (bundles.mjs), relative to // this directory. internal/shipped runs it and names the npm packages // those files are in; that list is the Colophon's JavaScript section. // Nothing is written: the build is in memory. import { build } from 'esbuild' import { join, dirname } from 'node:path' import { fileURLToPath } from 'node:url' import { bundles, options } from './bundles.mjs' const here = dirname(fileURLToPath(import.meta.url)) const inputs = new Set() for (const { name, entry, format = 'esm' } of bundles) { const result = await build({ ...options, entryPoints: [join(here, entry)], format, outfile: join(here, `${name}.js`), write: false, metafile: true, absWorkingDir: here }) for (const path of Object.keys(result.metafile.inputs)) inputs.add(path) } console.log(JSON.stringify([...inputs].sort()))