{"id":13493687,"url":"https://github.com/webpack-contrib/install-webpack-plugin","last_synced_at":"2025-04-14T08:53:38.381Z","repository":{"id":36984209,"uuid":"47086576","full_name":"webpack-contrib/install-webpack-plugin","owner":"webpack-contrib","description":"Speed up development by automatically installing \u0026 saving dependencies with Webpack.","archived":false,"fork":false,"pushed_at":"2023-03-07T03:56:43.000Z","size":2231,"stargazers_count":1432,"open_issues_count":43,"forks_count":75,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-03-09T07:39:35.174Z","etag":null,"topics":["webpack-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webpack-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"open_collective":"webpack"}},"created_at":"2015-11-30T00:40:53.000Z","updated_at":"2025-02-21T03:43:43.000Z","dependencies_parsed_at":"2024-01-10T18:34:53.606Z","dependency_job_id":null,"html_url":"https://github.com/webpack-contrib/install-webpack-plugin","commit_stats":{"total_commits":330,"total_committers":20,"mean_commits":16.5,"dds":0.3787878787878788,"last_synced_commit":"6c46b427810d3d1aad39e8fc0eb76cad21dac2e9"},"previous_names":["ericclemmons/npm-install-webpack-plugin","ericclemmons/webpack-npm-install-loader","webpack-contrib/npm-install-webpack-plugin"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Finstall-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Finstall-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Finstall-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Finstall-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webpack-contrib","download_url":"https://codeload.github.com/webpack-contrib/install-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243685565,"owners_count":20330982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["webpack-plugin"],"created_at":"2024-07-31T19:01:17.832Z","updated_at":"2025-03-31T00:09:11.284Z","avatar_url":"https://github.com/webpack-contrib.png","language":"JavaScript","readme":"[![npm][npm]][npm-url]\n[![deps][deps]][deps-url]\n[![test][test]][test-url]\n[![coverage][cover]][cover-url]\n[![chat][chat]][chat-url]\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- replace with accurate logo e.g from https://worldvectorlogo.com/ --\u003e\n  \u003ca href=\"https://github.com/webpack/webpack\"\u003e\n    \u003cimg width=\"200\" height=\"200\" vspace=\"\" hspace=\"25\"\n      src=\"https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon.svg\"\u003e\n  \u003c/a\u003e\n  \u003ch1\u003eInstall Webpack Plugin\u003c/h1\u003e\n  \u003cp\u003eSpeed up development by \u003cb\u003eautomatically installing \u0026 saving dependencies\u003c/b\u003e with Webpack.\u003c/p\u003e\n\u003c/div\u003e\n\nIt is inefficient to \u003ckbd\u003eCtrl-C\u003c/kbd\u003e your\nbuild script \u0026 server just to install\na dependency you didn't know you needed until now.\n\nInstead, use `require` or `import` how you normally would and installation\nwill happen **automatically to install \u0026 save missing dependencies** while you work!\n\n# Installation\n\n```bash\n$ npm install --save-dev install-webpack-plugin\n```\n\n# Usage\n\nIn your `webpack.config.js`:\n\n```js\nplugins: [\n  new InstallPlugin()\n],\n```\n\n**This is equivalent to**:\n\n```js\nplugins: [\n  new InstallPlugin({\n    dependencies: {\n      peer: true,\n    },\n    packageManager: {\n      type: this.getDefaultPackageManager(),\n      options: {\n        dev: false,\n        quiet: false,\n      },\n    },\n    prompt: true,\n  });\n],\n```\n\n# Options\n\n## dependencies\n\n**Type:** `Object`\n\nDependencies related options.\n\n### peer\n\n**Type:** `Boolean`\n\n**Default:** `true`\n\nInstall missing peer dependencies.\n\n```js\nplugins: [\n  new InstallPlugin({\n    dependencies: {\n      peer: true,\n    }\n  }),\n],\n```\n\n## packageManager\n\n**Type:** `'npm' | 'yarn' | 'pnpm' | Object | Function`\n\nPackage manager to use for installing dependencies.\n\n```js\nplugins: [\n  new InstallPlugin({\n      packageManager: 'yarn'\n    },\n  }),\n],\n```\n\nYou can provide a `Function` to the `packageManager` to make it dynamic:\n\n```js\nplugins: [\n  new InstallPlugin({\n    packageManager: function(module, path) {\n      return [\n        \"babel-preset-react-hmre\",\n        \"webpack-dev-middleware\",\n        \"webpack-hot-middleware\",\n      ].indexOf(module) !== -1;\n    },\n  }),\n],\n```\n\n### type\n\n**Type:** `'npm' | 'yarn' | 'pnpm'`\n\nName of package manager to use for installing dependencies.\n\n### options\n\n**Type:** `Object`\n\nPackage manager related options.\n\n### arguments\n\n**Type:** `Array`\n\nProvide custom arguments to use with package manager.\n\n```js\nplugins: [\n  new InstallPlugin({\n      packageManager: {\n        type: 'npm',\n        options: {\n          arguments: ['--ignore-scripts']\n        }\n      }\n    },\n  }),\n],\n```\n\n### dev\n\n**Type:** `Boolean`\n\n**Default:** `false`\n\nInstall as development dependencies.\n\n```js\nplugins: [\n  new InstallPlugin({\n      packageManager: {\n        type: 'npm',\n        options: {\n          dev: true,\n        }\n      }\n    },\n  }),\n],\n```\n\n### quiet\n\n**Type:** `Boolean`\n\n**Default:** `false`\n\nReduce the amount of console logging.\n\n```js\nplugins: [\n  new InstallPlugin({\n      packageManager: {\n        type: 'npm',\n        options: {\n          quiet: true,\n        }\n      }\n    },\n  }),\n],\n```\n\n## prompt\n\n**Type:** `Boolean`\n\n**Default:** `true`\n\nShow a prompt to confirm installation.\n\n```js\nplugins: [\n  new InstallPlugin({\n      prompt: true,\n    },\n  }),\n],\n```\n\n# Demo\n\n![install-webpack-plugin demo](https://cloud.githubusercontent.com/assets/15182/12540538/6a4e8f1a-c2d0-11e5-97ee-4ddaf6892645.gif)\n\n# Features\n\n- [x] Works with webpack `^v5.0.0`.\n- [x] Auto-installs `.babelrc` plugins \u0026 presets.\n- [x] Supports both ES5 \u0026 ES6 Modules.\n      (e.g. `require`, `import`)\n- [x] Supports Namespaced packages.\n      (e.g. `@cycle/dom`)\n- [x] Supports Dot-delimited packages.\n      (e.g. `lodash.capitalize`)\n- [x] Supports CSS imports.\n      (e.g. `@import \"~bootstrap\"`)\n- [x] Supports webpack loaders.\n      (e.g. `babel-loader`, `file-loader`, etc.)\n- [x] Supports inline webpack loaders.\n      (e.g. `require(\"bundle?lazy!./App\"`)\n- [x] Auto-installs missing `peerDependencies`.\n      (e.g. `@cycle/core` will automatically install `rx@*`)\n- [x] Supports webpack's `resolve.alias` \u0026 `resolve.root` configuration.\n      (e.g. `require(\"react\")` can alias to `react-lite`)\n\n## Contributing\n\nPlease take a moment to read our contributing guidelines if you haven't yet done so.\n\n[CONTRIBUTING](./.github/CONTRIBUTING.md)\n\n[npm]: https://img.shields.io/npm/v/install-webpack-plugin.svg\n[npm-url]: https://npmjs.com/package/install-webpack-plugin\n[deps]: https://david-dm.org/webpack-contrib/install-webpack-plugin.svg\n[deps-url]: https://david-dm.org/webpack-contrib/install-webpack-plugin\n[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg\n[chat-url]: https://gitter.im/webpack/webpack\n[test]: https://travis-ci.org/webpack-contrib/install-webpack-plugin.svg?branch=master\n[test-url]: https://travis-ci.org/webpack-contrib/install-webpack-plugin\n[cover]: https://codecov.io/gh/webpack-contrib/install-webpack-plugin/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack-contrib/install-webpack-plugin\n","funding_links":["https://opencollective.com/webpack"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Finstall-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebpack-contrib%2Finstall-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Finstall-webpack-plugin/lists"}