Fix for manifest not updating on initial build

This commit is contained in:
Berkeley Martinez
2015-11-11 13:51:46 -08:00
parent 0a46dc16a6
commit 545e545f51

View File

@ -272,8 +272,12 @@ var defaultStatsOptions = {
errorDetails: false errorDetails: false
}; };
var webpackCalled = false;
gulp.task('pack-watch', function(cb) { gulp.task('pack-watch', function(cb) {
var called = false; if (webpackCalled) {
console.log('webpack watching already runnning');
return cb();
}
gulp.src(webpackConfig.entry) gulp.src(webpackConfig.entry)
.pipe(plumber({ errorHandler: errorHandler })) .pipe(plumber({ errorHandler: errorHandler }))
.pipe(webpack(Object.assign( .pipe(webpack(Object.assign(
@ -286,9 +290,9 @@ gulp.task('pack-watch', function(cb) {
gutil.log(stats.toString(defaultStatsOptions)); gutil.log(stats.toString(defaultStatsOptions));
} }
if (!called) { if (!webpackCalled) {
debug('webpack watch completed'); debug('webpack init completed');
called = true; webpackCalled = true;
cb(); cb();
} }
@ -296,7 +300,7 @@ gulp.task('pack-watch', function(cb) {
.pipe(gulp.dest(webpackConfig.output.path)); .pipe(gulp.dest(webpackConfig.output.path));
}); });
gulp.task('pack-watch-manifest', function() { gulp.task('pack-watch-manifest', ['pack-watch'], function() {
var manifestName = 'react-manifest.json'; var manifestName = 'react-manifest.json';
var dest = webpackConfig.output.path; var dest = webpackConfig.output.path;
return gulp.src(dest + '/bundle.js') return gulp.src(dest + '/bundle.js')