rollup-plugin-rewrite
🔎 Modify rollup output with find / replace dynamically. It is similar to rollup-plugin-modify but uses renderChunk
hook to transform final processed output for each chunk
Usage
npm i rollup-plugin-rewrite
Find and replace using regex
plugins:
Example (replace method argument)
following code will replace importShim(./bla)
to importShim(./publicPath/bla)
I use this snippet to update paths of dynamic imports during build time