GithubHelp home page GithubHelp logo

alexxnica / webpack-cluster Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fitbit/webpack-cluster

0.0 1.0 0.0 3.18 MB

Helps to make parallel webpack compilation easily

Home Page: https://fitbit.github.io/webpack-cluster

License: Apache License 2.0

JavaScript 100.00%

webpack-cluster's Introduction

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

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));
    });
});

webpack-cluster's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar mdreizin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.