webpack-glob
v2.0.2
Published
webpack + glob = ❤️
Downloads
1,200
Readme
webpack + glob = :heart:
For API docs please see the documentation page.
$ 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]
'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));
});
});