// fixtures/bundles.mjs — the bundles the app ships, in one list. // build-bundles.mjs builds and commits them; colophon-inputs.mjs builds // the same list again, in memory, to name the packages inside them for // the Colophon (internal/shipped). One list, so the Colophon cannot // describe a bundle the app does not ship or miss one it does. // // The names here are the names internal/docs/assets.go's bundleKinds // expects; that file panics at init if one of them has no committed // file, so a build that silently stopped emitting one cannot start. // // Two bundles are kept separate on purpose. The editor is ProseMirror // and Yjs — about 300KB — and only a document page needs it. The // jump-to palette is a few KB and every signed-in page needs it, // including the list. Bundling them together would make opening the // list download an editor in order to offer a keyboard shortcut. export const bundles = [ { name: 'editor', entry: 'editor-entry.js' }, { name: 'jumpto', entry: 'jump-to.mjs' }, // The share page's Copy button: a few hundred bytes, and only that // page needs it. { name: 'share', entry: 'share-link.mjs' }, // The font gate: every document page, writer or reader, before the // editor (fonts-gate.mjs). { name: 'fontsgate', entry: 'fonts-gate.mjs' }, // The hold: a classic, blocking script in , so an IIFE. { name: 'fontshold', entry: 'fonts-hold.js', format: 'iife' }, ] // The esbuild options every bundle is built with. export const options = { bundle: true, minify: true, target: 'es2020' }