3.2.0 • Published 8 years ago

webpack-cluster v3.2.0

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
8 years ago

NPM version Travis build status AppVeyor build status Code Climate GPA Code Climate Coverage Dependency Status Development Dependency Status Greenkeeper badge

webpack-cluster

Helps to make parallel webpack compilation easily

npm.io

Installation

npm install webpack-cluster --save-dev

or

yarn add webpack-cluster --dev

Usage

CLI

$ webpack-cluster --config=**/webpack.config.js [options]

Options:
  --config       Specifies configuration files using `glob` pattern
                                                              [array] [required]
  --failures     Sets failure options                            [default: true]
  --watch        Enables `watch` mode                                  [boolean]
  --dryRun       Enables `dryRun` mode                                 [boolean]
  --concurrency  Sets maximum number of concurrent compilers
                                                           [number] [default: 8]
  --silent       Suppress all output                                   [boolean]

Miscellaneous:
  --version  Outputs version number                                    [boolean]

Node API

import WebpackCluster from 'webpack-cluster';

const webpackCluster = new WebpackCluster({
    dryRun: false,
    concurrency: 10,
    failures: {
        sysErrors: true,
        errors: true,
        warnings: true
    }
});

webpackCluster.run([
    './src/**/webpack.config.js'
]).then(results => { // In case of success
    console.log(results); // ['./src/app1/webpack.config.js', './src/app2/webpack.config.js']
}).catch(results => { // In case of any errors
    console.log(results); // [Error { filename: './src/app3/webpack.config.js', code: 2 }]
});

./gulpfile.js

import gulp from 'gulp';
import gutil from 'gulp-util';
import WebpackCluster from 'webpack-cluster';

const webpackCluster = new WebpackCluster({
    dryRun: false,
    concurrency: 10,
    failures: {
        sysErrors: true,
        errors: true,
        warnings: true
    }
});

gulp.task('run', [], callback => {
    webpackCluster.run([
        './src/**/webpack.config.js'
    ]).then(callback).catch(err => {
        callback(new gutil.PluginError('webpack-cluster', err));
    });
});

gulp.task('watch', [], callback => {
    webpackCluster.watch([
        './src/**/webpack.config.js'
    ]).then(callback).catch(err => {
        callback(new gutil.PluginError('webpack-cluster', err));
    });
});
3.2.0

8 years ago

3.1.0

8 years ago

3.0.0

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.3.2

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago