rollup-plugin-pre-inject
v4.0.0
Published
plugin to prepends bundles with custom code (can be used to inject anything)
Downloads
2
Readme
rollup-plugin-polyfill
Rollup Plugin to inject any code you want at the top of your input file.
This is useful for injecting polyfills, or different global settings for your build variants.
Usage
Check out the example folder to see more configurations
const preInject = require('rollup-plugin-polyfill')
export default {
input: 'index.js',
output: {
file: 'bundle.js',
format: 'iife',
name: 'example'
},
plugins: [
preInject({
sourceMap: false, // defaults to true
injectCode: "", // Injected at the top of the input file
}),
]
}
example
Check out the /example folder:
- Look at
logAddFiveAndOne.js
- Look at options passed to the pre-inject plugin
To see it in action, run:
npm install
npm run example