oficina / docs Public

Clone
git clone https://amadan.net/oficina/docs

Plain git — no account needed to clone.

Download

Download this file

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