0.1.1 • Published 9 years ago
gulp-webpack-through2 v0.1.1
gulp-webpack-through2
Run WebPack with through2 for gulp.
Usage
var gulp = require('gulp');
var webpack = require('gulp-webpack-through2');
gulp.task('default', function() {
return gulp.src('src/entry.js')
.pipe(webpack({
watch: true,
output: {
filename: '[name].bundle.js'
}
}, {
timings: true,
errorDetails: true
}))
.pipe(gulp.dest('build/'));
});webpack(webpackConfig,statOptions)
webpackConfiginclude webpackConfigprogressshow webpack progress
verboseshow all stats information
compress配置不转换直接压缩的js文件,包含uglifyjs的配置
compress: { entry: { vendor: ['src/a.js', 'src/b.js'] }, compress:false //不压缩只合并 }, output: { filename: '[name].bundle.js' } //压缩合并`a.js`+ `b.js` => `wendor.bundle.js`
statsOptionscontext(string) context directory for request shortening
hashadd the hash of the compilation
versionadd webpack version information
timingsadd timing information
assetsadd assets information
chunksadd chunk information (setting this to false allows for a less verbose output)
chunkModulesadd built modules information to chunk information
modulesadd built modules information
childrenadd children information
cachedadd also information about cached (not built) modules
reasonsadd information about the reasons why modules are included
sourceadd the source code of modules
errorDetailsadd details to errors (like resolving log)
chunkOriginsadd the origins of chunks and chunk merging info
modulesSort(string) sort the modules by that field
chunksSort(string) sort the chunks by that field
assetsSort(string) sort the assets by that field
Installation
$ npm install gulp-webpack-through2Features
- 通过
gulp运行webpack - 配置
js文件直接压缩不处理 |
Examples
To run the examples, clone the gulp-webpack-through2 repo and install the dependencies:
$ git clone git://github.com/Jetsly/gulp-webpack-through2
$ npm install gulp -g
$ npm install
$ gulp --gulpfile=example/gulpfile.jsTests
To run the test suite, first install the dependencies, then run npm test:
$ npm install
$ npm test