4.0.0 • Published 3 years ago

rollup-plugin-pre-inject v4.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

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
4.0.0

3 years ago