From c8fbcc14d1548981c6f27357abab42857b138cb9 Mon Sep 17 00:00:00 2001 From: Erin Date: Fri, 28 Jul 2023 08:08:07 -0400 Subject: [PATCH] some basic documentation --- index.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index b586837..25da230 100644 --- a/index.ts +++ b/index.ts @@ -3,10 +3,24 @@ import {readFileSync} from 'node:fs'; import {resolve, basename, extname, dirname, relative, join} from 'node:path'; -import {getAssetEntrypoints, getScriptEntrypoints} from './entrypoints'; - import {type RollupOptions, type Plugin} from 'rollup'; +import {getAssetEntrypoints, getScriptEntrypoints} from './entrypoints'; + +/** + * Looks through a `manifest.json` file for Javascript entrypoints and other + * assets, and returns an array of Rollup configuration. This configuration will + * have each entrypoint processed as its own bundle, and will additionally + * handle copying the manifest and other assets into the build output, as well + * as any necessary path rewriting in the manifest itself. + * @param options + * @param options.manifest Path to the manifest file to be processed, relative + * to the current working directory + * @param options.outDir Directory path where build output will go + * @param options.plugins Rollup plugins to be used when processing each + * Javascript entry point + * @param options.sourcemap Controls inclusion of sourcemaps in the output + */ export function buildConfig ({ manifest: manifestPathRelative, outDir,