Skip to content
PluginStats

copy-pkg-json-webpack-plugin weekly downloads statistics

By pmsandhu · npm · Webpack plugins

A webpack plugin to copy package.json file with desired key props into build directory

View on npm Fresh · Dec 6, 2026

copy-pkg-json-webpack-plugin has 2,515 recorded weekly downloads on npm, a decrease of 13.9% over the past 30 days, ranking #1808 of 3,247 tracked listings.

Weekly downloads
2,515
Official API · Dec 5, 2026
7-day growth
+10.6%
+242 weekly downloads
30-day growth
-13.9%
-406 weekly downloads
90-day growth
+107%
+1.3K weekly downloads
Rank
#1808
▼ 55 in 7 days

About copy-pkg-json-webpack-plugin

CopyPackageJsonPlugin

This is a plugin to copy and edit your package.json file to your webpack distribution/production bundle. This is useful for updating the version number of your package and only including the necessary information in your package.json bundle that consumer of your application/package need.

Install

$ npm install copy-pkg-json-webpack-plugin --save-dev

Usage

// webpack.config.js
const CopyPkgJsonPlugin = require("copy-pkg-json-webpack-plugin")
module.exports = {
  entry: '//...',
  output: '//...',
  plugins: [
    new CopyPkgJsonPlugin({
      remove: ['devDependencies'],
      replace: {scripts: {start: 'node index.js'}}
    })
  ]
}
// webpack.config.js
const CopyPkgJsonPlugin = require("copy-pkg-json-webpack-plugin")
const pkg = require('./package.json')
module.exports = {
  entry: '//...',
  output: '//...',
  plugins: [
    new CopyPkgJsonPlugin({      
      new: {
        name: pkg.name,
        version: '1.2.0',
        description: pkg.description,
        repository: pkg.repository,
        peerDependencies: {
          react: 'latest',
          'react-dom': 'latest'
        },
        devDependencies: {
          colors: 'latest'
        } 
      }
    })
  ]
}

Options

Options are passed as arguments to the new CopyPkgJsonPlugin({ options }) constructor and must be an object containing either a new key with an object containing the key/value pairs you wish to populate your new package.json with, a remove key with an array containing properties you want to remove from your existing package.json as strings and/or a replace key with an object containing the key/value pairs you wish to replace from your original package.json with. You may optionally pass in the absolute path string to the directory containing your package.json file. The plugin defaults to process.cwd() path. See the NOTE section below for more information on specifying the package.json directory path.

new CopyPkgJsonPlugin(
  { new: {/*...*/} },
  /* OR */
  {  remove: [/*...*/], replace: {/*...*/} }, 
  /* 'OPTIONAL/PATH/TO/pckJSON/DIRECTORY' */
 )
New

The new key expects an object with the standard package.json fields that you wish to be made available in your final bundle's package.json

plugins : [
  new CopyPackageJsonPlugin({
    new: {
      name: 'my-package',
      version: '3.0.1',
      description: 'my package to publish to npm',
      author: 'Mario Lopez',
      license: 'MIT',
      private: false,
      peerDependencies: { d3: 'latest'}
    }
  })
] 
Remove

The remove key expects an array with property names from your original package.json file that you wish to not be included in the copied package.json

plugins : [
  new CopyPackageJsonPlugin({
    remove: ['scripts', 'jest', 'devDependencies]']
  })
] 
Replace

The replace key expects an object with property names from your original package.json file that you wish to replace with different properties

plugins : [
  new CopyPackageJsonPlugin({
    replace: {
      version: '1.2.1',
      author: 'Mario Lopez',
      scripts: { start: 'node index.js', test: 'echo' }    
    }
  })
] 

By default this will merge keys by one level deep. So using the example above if your original package.json also included other scripts such as build command that script will be included in the copied package.json

{
  "scripts": {
    "start": "node index.js", 
    "test":"echo", 
    "build": "webpack src" 
  }
}   

If you do not want the existing keys to be merged and want to overwrite them you must add the the key to the remove option first

plugins : [
  new CopyPackageJsonPlugin({
    remove: ['scripts'],
    replace: {
      scripts: { start: 'node index.js', test: 'echo' }    
    }
  })
] 
Note

This plugin assumes that your package.json is in the root directory of the node processes current working directory ie. process.cwd(). If your package.json is located elsewhere, you may optionally pass the absolute path of the directory where your package.json resides, as a second argument to new CopyPkgJsonPlugin constructor. NOTE: that you must pass in a first argument in order to pass in the context; if you wish to simply copy your existing package.json you can pass in an empty object :

plugins: [ 
  new CopyPkgJsonPlugin({}, 'src/app/hello') 
]

If you wish to create a brand new package.json to be copied to the final dist bundle folder, pass an object with the key new which contains the key value pairs that you would like to be in your package.json:

plugins: [
  new CopyPkgJsonPlugin({ new: {
    name: 'state-manager-lib',
    description: 'state management library',
    main: 'index.js',
    version: '2.0',
    license: 'MIT',
    dependencies: { lodash: 'latest', redux: 'latest' },
    devDependencies: { 'chalk': 'latest', 'state-invariant': 'latest' }
  }}) 
]

If you wish to simply copy your existing package.json your to the final dist bundle folder without any modifications and your package.json is located in the node processes current working directory ie process.cwd(), simply call the constructor without arguments and your package.json is located at the root :

plugins: [
  new CopyPkgJsonPlugin() 
]

If you which to remove an item from your existing package.json but not replace any just pass in this key:

plugins: [ 
  new CopyPkgJsonPlugin({ remove: ['engines','devDependencies'] }) 
]

And vice-versa if you wish to replace in an existing package.json but not remove any items:

plugins: [ 
  new CopyPkgJsonPlugin({ replace: { author: 'Mario Lopez' } }) 
]

Description from the npm listing.

  • webpack
  • webpack-plugin
  • package.json
  • production
  • copy
  • copy package.json

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

copy-pkg-json-webpack-plugin weekly downloads on npm, last 90 days: 2,515 weekly downloads as of Dec 5, 2026, +107% over 90 days.copy-pkg-json-webpack-pluginWeekly downloads on npm · Last 90 days2,515downloads / week+107% over 90 days05001K1.5K2K2.5K3K3.5KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
copy-pkg-json-webpack-plugin weekly downloads on npm, last 90 days: 2,515 weekly downloads as of Dec 5, 2026, +107% over 90 days.

7/30/90-day growth

copy-pkg-json-webpack-plugin weekly downloads growth on npm: +10.6% over 7 days, -13.9% over 30 days, +107% over 90 days.copy-pkg-json-webpack-pluginWeekly downloads growth on npm2,515downloads / week now7-day growth+242 weekly downloads+10.6%30-day growth-406 weekly downloads-13.9%90-day growth+1,302 weekly downloads+107%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
copy-pkg-json-webpack-plugin weekly downloads growth on npm: +10.6% over 7 days, -13.9% over 30 days, +107% over 90 days.

Ranking history

copy-pkg-json-webpack-plugin npm ranking history: currently #1808 (by weekly downloads).copy-pkg-json-webpack-pluginnpm ranking · by weekly downloads · Last 90 days#1808current rank#400#600#800#1000#1200#1400#1600#1800#2000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
copy-pkg-json-webpack-plugin npm ranking history: currently #1808 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 91, #8 (overall #1,808)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins349 listings · 18 pages · page 3, #14 (overall #54)
Webpack plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (592)
Recent weekly downloads observations for copy-pkg-json-webpack-plugin
Date (UTC)Weekly downloadsChange vs. previous
2,515-36
2,551+173
2,378-106
2,484-32
2,516+93
2,423+105
2,318+45
2,273-162
2,435-166
2,601-5
2,606+41
2,565+191
2,374-181
2,555—

Similar npm Webpack plugins plugins

All 20 copy-pkg-json-webpack-plugin alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/copy-pkg-json-webpack-plugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.