Fix for manifest not updating on initial build

pull/4696/head
Berkeley Martinez 2015-11-11 13:51:46 -08:00
parent 0a46dc16a6
commit 545e545f51
1 changed files with 9 additions and 5 deletions

View File

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