Skip to content
David Reed edited this page Nov 20, 2026 · 1 revision

@sysce/estrogen/rollup is a Rollup plugin that runs estrogen after the build, over the output directory.

import { pluginEstrogen } from '@sysce/estrogen/rollup';

export default {
	input: 'src/index.js',
	output: { dir: 'dist', format: 'es' },
	plugins: [pluginEstrogen()],
};

The named export is pluginEstrogen(options?): Plugin (also the default export). It runs in writeBundle, after Rollup writes the files, over output.dir (or the directory of output.file). If any file fails, the build fails: estrogen fails closed and writes no partial output for a failing file.

Options

Pass the Node API options object to override what the plugin infers. It infers dirs from the output directory, so you usually set only the per-site data files:

plugins: [pluginEstrogen({ config: 'estrogen.toml' })];
plugins: [
	pluginEstrogen({ names: 'estrogen.names.json', canary: 'canary-list.json' }),
];

See Configuration for the config file.

Run once

estrogen is not idempotent. The plugin runs once per build, in writeBundle. Do not add it twice, and confirm each build writes a fresh output directory rather than reprocessing one estrogen already rewrote.

Source maps

By default estrogen writes no map and strips sourceMappingURL comments from the chunks it processes. If Rollup is set to emit maps, those bundler maps point at pre-obfuscation source and estrogen keeps them out of the served output. For a private debug map, pass sourcemap in the plugin options to write it outside the build. See Source maps.

Clone this wiki locally