A simple Rollup plugin to prepend content to entry chunk
As follows:
Install the plugin
npm install --save-dev rollup-plugin-banner
Add it to your rollup configuration:
import entryBanner from 'rollup-plugin-entry-banner';
// const { bannerEntry } = require('rollup-plugin-entry-banner'); /* use commonjs */
export default {
plugins: [
entryBanner()
]
}
Note: it can also be used in Vite.
name | type | required | default | description |
---|---|---|---|---|
packageJsonDir | string | false | process.cwd() |
the directory path of The package.json file |
preset | boolean | false | true | whether apply the preset of the banner style (It includes the log style shown in the above picture. ) |
renderBanner | function | false | undefined | customize the output banner content |