some basic documentation

This commit is contained in:
Erin 2023-07-28 08:08:07 -04:00
parent a2cb7ec931
commit c8fbcc14d1

View file

@ -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,