Пример #1
0
gulp.task('webpack', [], function() {
    return gulp.src(path.join(src, '**', webpack.config.CONFIG_FILENAME), { base: path.resolve(src) })
        .pipe(webpack.configure(webpackConfig))
        .pipe(webpack.overrides(webpackOptions))
        .pipe(webpack.compile())
        .pipe(webpack.format(webpackFormat))
        .pipe(webpack.failAfter(webpackFailAfter))
        .pipe(gulp.dest(dest));
});
Пример #2
0
gulp.task('webpack', ['clean', 'lint'], function() {
    return gulp.src(webpack.config.CONFIG_FILENAME)
        .pipe(webpack.configure(webpackConfig))
        .pipe(webpack.compile())
        .pipe(webpack.format({
            version: false,
            timings: true
        }))
        .pipe(webpack.failAfter({
            errors: true,
            warnings: true
        }))
        .pipe(gulp.dest(pkg.paths.dest.baseDir));
});
Пример #3
0
 gulp.watch(pkg.paths.source.js).on('change', function(event) {
     if (event.type === 'changed') {
         gulp.src(webpack.config.CONFIG_FILENAME)
             .pipe(webpack.configure(webpackConfig))
             .pipe(webpack.watch(function(err, stats) {
                 gulp.src(pkg.paths.source.js)
                     .pipe(webpack.proxy(err, stats))
                     .pipe(webpack.format({
                         verbose: true,
                         version: false
                     }))
                     .pipe(gulp.dest(pkg.paths.dest.baseDir));
             }));
     }
 });