All Projects → webpack-contrib → Npm Install Webpack Plugin

webpack-contrib / Npm Install Webpack Plugin

Licence: mit
Speed up development by automatically installing & saving dependencies with Webpack.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Npm Install Webpack Plugin

Nvue
master分支:webpack4实现一个vue的打包的项目,incremental: 实现增量模块打包
Stars: ✭ 55 (-96.18%)
Mutual labels:  webpack-plugin
Page Builder
自定义页面构建平台
Stars: ✭ 81 (-94.38%)
Mutual labels:  webpack-plugin
Webpack Core Usage
webpack2完整系列课程,欢迎阅读。同时欢迎移步我的react全家桶文章全集: https://github.com/liangklfangl/react-article-bucket
Stars: ✭ 94 (-93.48%)
Mutual labels:  webpack-plugin
Snackui
SnackUI 🍑 - the final React style library. With an *optimizing compiler* that lets you write views naturally, with easier DX, working on native and web at once, all while being faster than hand-rolling your own CSS.
Stars: ✭ 55 (-96.18%)
Mutual labels:  webpack-plugin
Moment Timezone Data Webpack Plugin
Reduce moment-timezone data size for a webpack build
Stars: ✭ 80 (-94.45%)
Mutual labels:  webpack-plugin
Add Asset Webpack Plugin
Dynamically add an asset to the Webpack graph
Stars: ✭ 84 (-94.17%)
Mutual labels:  webpack-plugin
Treat
🍬 Themeable, statically extracted CSS‑in‑JS with near‑zero runtime.
Stars: ✭ 1,058 (-26.58%)
Mutual labels:  webpack-plugin
Gas Webpack Plugin
Webpack plugin for Google Apps Script
Stars: ✭ 97 (-93.27%)
Mutual labels:  webpack-plugin
Compression Webpack Plugin
Prepare compressed versions of assets to serve them with Content-Encoding
Stars: ✭ 1,228 (-14.78%)
Mutual labels:  webpack-plugin
Jest Webpack
Use jest with webpack.
Stars: ✭ 89 (-93.82%)
Mutual labels:  webpack-plugin
Vue Builder Webpack Plugin
Webpack plugin to build vue files automatically
Stars: ✭ 70 (-95.14%)
Mutual labels:  webpack-plugin
Svg Sprite Webpack Plugin
Webpack plugin for loading/extracting SVGs into a sprite file
Stars: ✭ 73 (-94.93%)
Mutual labels:  webpack-plugin
Auxpack
A dashboard for monitoring Webpack build stats.
Stars: ✭ 86 (-94.03%)
Mutual labels:  webpack-plugin
Optimize Css Assets Webpack Plugin
A Webpack plugin to optimize \ minimize CSS assets.
Stars: ✭ 1,082 (-24.91%)
Mutual labels:  webpack-plugin
Fork Ts Checker Webpack Plugin
Webpack plugin that runs typescript type checker on a separate process.
Stars: ✭ 1,343 (-6.8%)
Mutual labels:  webpack-plugin
Node Env Webpack Plugin
Simplified `NODE_ENV` handling with webpack
Stars: ✭ 51 (-96.46%)
Mutual labels:  webpack-plugin
Google Fonts Plugin
Webpack plugin that downloads fonts from Google Fonts and encodes them to base64
Stars: ✭ 83 (-94.24%)
Mutual labels:  webpack-plugin
Webpack Tools
☕️Just a simple webpack sample project.
Stars: ✭ 106 (-92.64%)
Mutual labels:  webpack-plugin
Uglifyjs Webpack Plugin
[deprecated] UglifyJS Plugin
Stars: ✭ 1,343 (-6.8%)
Mutual labels:  webpack-plugin
Ngc Webpack
Angular compiler-cli with webpack's loader chain.
Stars: ✭ 87 (-93.96%)
Mutual labels:  webpack-plugin

npm deps test coverage chat

Install Webpack Plugin

Speed up development by automatically installing & saving dependencies with Webpack.

It is inefficient to Ctrl-C your build script & server just to install a dependency you didn't know you needed until now.

Instead, use require or import how you normally would and installation will happen automatically to install & save missing dependencies while you work!

Installation

$ npm install --save-dev install-webpack-plugin

Usage

In your webpack.config.js:

plugins: [
  new InstallPlugin()
],

This is equivalent to:

plugins: [
  new InstallPlugin({
    dependencies: {
      peer: true,
    },
    packageManager: {
      type: this.getDefaultPackageManager(),
      options: {
        dev: false,
        quiet: false,
      },
    },
    prompt: true,
  });
],

Options

dependencies

Type: Object

Dependencies related options.

peer

Type: Boolean

Default: true

Install missing peer dependencies.

plugins: [
  new InstallPlugin({
    dependencies: {
      peer: true,
    }
  }),
],

packageManager

Type: 'npm' | 'yarn' | 'pnpm' | Object | Function

Package manager to use for installing dependencies.

plugins: [
  new InstallPlugin({
      packageManager: 'yarn'
    },
  }),
],

You can provide a Function to the packageManager to make it dynamic:

plugins: [
  new InstallPlugin({
    packageManager: function(module, path) {
      return [
        "babel-preset-react-hmre",
        "webpack-dev-middleware",
        "webpack-hot-middleware",
      ].indexOf(module) !== -1;
    },
  }),
],

type

Type: 'npm' | 'yarn' | 'pnpm'

Name of package manager to use for installing dependencies.

options

Type: Object

Package manager related options.

arguments

Type: Array

Provide custom arguments to use with package manager.

plugins: [
  new InstallPlugin({
      packageManager: {
        type: 'npm',
        options: {
          arguments: ['--ignore-scripts']
        }
      }
    },
  }),
],

dev

Type: Boolean

Default: false

Install as development dependencies.

plugins: [
  new InstallPlugin({
      packageManager: {
        type: 'npm',
        options: {
          dev: true,
        }
      }
    },
  }),
],

quiet

Type: Boolean

Default: false

Reduce the amount of console logging.

plugins: [
  new InstallPlugin({
      packageManager: {
        type: 'npm',
        options: {
          quiet: true,
        }
      }
    },
  }),
],

prompt

Type: Boolean

Default: true

Show a prompt to confirm installation.

plugins: [
  new InstallPlugin({
      prompt: true,
    },
  }),
],

Demo

install-webpack-plugin demo

Features

  • Works with webpack ^v5.0.0.
  • Auto-installs .babelrc plugins & presets.
  • Supports both ES5 & ES6 Modules. (e.g. require, import)
  • Supports Namespaced packages. (e.g. @cycle/dom)
  • Supports Dot-delimited packages. (e.g. lodash.capitalize)
  • Supports CSS imports. (e.g. @import "~bootstrap")
  • Supports webpack loaders. (e.g. babel-loader, file-loader, etc.)
  • Supports inline webpack loaders. (e.g. require("bundle?lazy!./App")
  • Auto-installs missing peerDependencies. (e.g. @cycle/core will automatically install rx@*)
  • Supports webpack's resolve.alias & resolve.root configuration. (e.g. require("react") can alias to react-lite)

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

CONTRIBUTING

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].