rollup-plugin-generate-package-json
Generate package.json
file with packages from your bundle using Rollup.
About
This plugin is useful when you have a lot of packages in your current package.json
file and want to create a lean one with only packages from your generated bundle, probably for deployment.
Installation
# yarn yarn add rollup-plugin-generate-package-json -D # npm npm install rollup-plugin-generate-package-json -D
Usage
// rollup.config.js input: 'src/index.js' output: file: 'dist/app.js' format: 'cjs' plugins:
Configuration
There are some useful options, all of them are optional:
inputFolder
Type: string
Default: current working directory
Set input package.json
folder.
outputFolder
Type: string
Default: bundle output folder
Set output folder for generated package.json
file.
baseContents
Type: object | function
Default: {}
Set base contents for your generated package.json
file.
It can also be a function, which receives the contents of the input package.json
file.
additionalDependencies
Type: Array | object
Default: []
Set dependencies which are not directly imported in the bundle, but are used by the app.
It's also possible to add new dependencies or overwrite dependency version.
License
MIT