node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org »

webpack-glob

NPM version Travis build status AppVeyor build status Code Climate Code Climate Dependency Status Dependency Status

webpack + glob = ❤️

Documentation

For API docs please see the documentation page.

Usage

CLI

$ webpack-glob --config=./src/**/webpack.config.js [options]
 
Compiler:
  --config    Specifies configuration files using `minimatch` pattern
                                                             [string] [required]
  --progress  Displays compilation progress           [boolean] [default: false]
  --json      Saves `stats` object to JSON file       [boolean] [default: false]
  --watch     Runs webpack compiler in `watch` mode   [boolean] [default: false]
  --memoryFs  Compiles to memory                      [boolean] [default: false]
 
Webpack:
  --profile  Captures timing information for each module
                                                      [boolean] [default: false]
  --[*]      Many configuration options are mapped from CLI automatically
                                                                   [default: {}]
 
Miscellaneous:
  --version  Outputs the version number                                 [string]
 

Gulp.js

'use strict';
 
var gulp = require('gulp'),
    gutil = require('gulp-util'),
    WebpackGlob = require('webpack-glob');
 
var webpackOptions = {
        output: {
            path: './dist'
        },
        stats: {
            colors: true,
            hash: true,
            timings: true,
            chunks: false,
            chunkModules: false,
            modules: false,
            children: true,
            version: false,
            cached: false,
            cachedAssets: false,
            reasons: false,
            source: false,
            errorDetails: false
        }
    },
    compilerOptions = {
        progress: false,
        json: false,
        memoryFs: false
    };
 
gulp.task('webpack', [], function(callback) {
    var webpack = new WebpackGlob(compilerOptions, webpackOptions);
 
    webpack.run('./src/**/webpack.config.js').then(function() {
        callback();
    }).catch(function(err) {
        callback(new gutil.PluginError('webpack', err));
    });
});