0.0.2 • Published 7 years ago

webpack-null-plugin v0.0.2

Weekly downloads
907
License
ISC
Repository
-
Last release
7 years ago

Installation

npm i -S webpack-null-plugin

Usage

This plugin uses the null object pattern to simplify webpack configs with conditional plugins.

For example, perhaps you only want to run the start-server-webpack-plugin plugin when the environment variable WEBPACK_START_SERVER equals 1:

const StartServerPlugin = require('start-server-webpack-plugin');
const NullPlugin = require('webpack-null-plugin');
const shouldRunServer = process.env.WEBPACK_START_SERVER === '1';

module.exports = {
  /* ...rest of config... */
  plugins: [
    shouldRunServer ? new StartServerPlugin('index.js') : new NullPlugin(),
  ],
};
0.0.2

7 years ago

0.0.1

7 years ago