Registry / devops / rollup-plugin-postprocess

rollup-plugin-postprocess

JSON →
library1.0.2jsnpmunverified

A Rollup plugin that applies regex-based find-and-replace postprocessing to bundle output. Version 1.0.2 is the latest stable release with minimal release cadence. It works like JavaScript String replace, supporting function callbacks and sequential replacement pairs. Differentiates from other replace plugins by operating after all other plugins, allowing transformation of the final bundle.

npm install rollup-plugin-postprocess
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-POST
R
rollup-plugin-postprocess
devopsjavascriptv1.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

postprocess
import postprocess from 'rollup-plugin-postprocess'
const { postprocess } = require('rollup-plugin-postprocess')
Default export only; named export is not available.

Replaces all occurrences of FIND_ME with REPLACED in the final bundle using rollup-plugin-postprocess.

import postprocess from 'rollup-plugin-postprocess'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'iife' }, plugins: [ postprocess([ [/\bFIND_ME\b/g, 'REPLACED'] ]) ] };
Debug
Known issues
gotchaPatterns are applied as String.replace, not RegExp replacement with full support for flags like 'g'.
fix
Use global flag in regex: /foo/g instead of just /foo/.
affects: >=1.0
gotchaWhen using function callback for replacement, returning undefined removes the match (empty string).
fix
Return empty string '' explicitly to keep match removal behavior clear.
affects: >=1.0
gotchaPatterns are executed sequentially on the entire bundle, so later patterns can match text inserted by earlier ones.
fix
Design patterns carefully to avoid unintended interactions.
affects: >=1.0
Errors
Common errors & fixes
TypeError: postprocess is not a function
Named import instead of default import.
fix
Use `import postprocess from 'rollup-plugin-postprocess'`.
Error: [object Object] is not a valid replacement pair
Passed an object instead of an array of arrays.
fix
Supply an array of [regex, replacement] arrays: `postprocess([[ /pattern/, 'replacement' ]])`.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-postprocess — npm install rollup-plugin-postprocess · libregistry