Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-generate-package-json

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-generate-package-json

Generate package.json file with packages from your bundle using Rollup

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26K
increased by9.22%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-generate-package-json

Build Status Codecov

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 and want to create a lean one with only packages from your generated bundle, probably for deployment.

Installation

npm install rollup-plugin-generate-package-json --save-dev
# or
yarn add rollup-plugin-generate-package-json -D

Usage

// 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()
  ]
}

Options

There are some useful options, all of them are optional:

inputFolder

Set input package.json folder. By default, current working directory is used.

generatePackageJson({
  inputFolder: 'nested/folder'
})

outputFolder

Set output folder for generated package.json file. By default, bundle output folder is used.

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']
})

License

MIT

Keywords

FAQs

Package last updated on 03 Feb 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc