
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
rollup-plugin-generate-package-json
Advanced tools
Generate package.json file with packages from your bundle using Rollup
Generate package.json
file with packages from your bundle using Rollup.
This plugin is useful when you have a lot of packages in your current package.json
and want to create a lean one with only packages from your generated bundle, probably for deployment.
npm install rollup-plugin-generate-package-json --save-dev
# or
yarn add rollup-plugin-generate-package-json -D
// rollup.config.js
import generatePackageJson from 'rollup-plugin-generate-package-json'
export default {
input: 'src/index.js',
output: {
file: 'dist/app.js',
format: 'cjs'
},
plugins: [
generatePackageJson()
]
}
There are some useful options, all of them are optional:
inputPackageJson
Set input package.json
file path, it can be a file or a directory. By default, root package.json
file is used.
generatePackageJson({
inputPackageJson: 'nested/folder'
})
outputFolder
Set output folder where generated package.json
file will be saved. By default, it is the same folder where bundle was saved.
generatePackageJson({
outputFolder: 'dist'
})
baseContents
Set base contents for your generated package.json
file.
generatePackageJson({
baseContents: {
scripts: {
start: 'node app.js'
},
dependencies: {},
private: true
}
})
additionalDependencies
Set additional dependencies which were not used in the bundle, but are used by the app.
generatePackageJson({
additionalDependencies: ['pg']
})
MIT
FAQs
Generate package.json file with packages from your bundle using Rollup
The npm package rollup-plugin-generate-package-json receives a total of 18,717 weekly downloads. As such, rollup-plugin-generate-package-json popularity was classified as popular.
We found that rollup-plugin-generate-package-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.