rollup-plugin-replacer
v1.0.3
Published
a rollup plugin to replace strings in generated bundles
Downloads
4
Maintainers
Readme
rollup-plugin-replacer
Replace strings after files have been bundled, to reach all processed files like (.css, .svg etc.)
Installation
npm install --save-dev rollup-plugin-replacer
Instructions
Because rollup-plugin-replacer starts at the end of the bundling process, you have to be sure that it is placed after other plugins in your plugins
array.
// rollup.config.js
import replacer from 'rollup-plugin-replacer';
export default {
// ...
plugins: [
replacer({
replace: {
'../fonts': 'fonts',
'../img': path.join(mediapath, 'img')
}
})
]
};
Options
{
// replace patterns property to value
replace: {
'oldstring': 'newstring'
}
// pattern, or array of patterns
include: 'bundle.css',
// also pattern, or array of patterns
exclude: 'node_modules/**',
}
License
MIT