Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browserify bundle() seems doesn't work properly with watchify 'update' event #186

Closed
just4fun opened this issue Apr 4, 2015 · 1 comment

Comments

@just4fun
Copy link

just4fun commented Apr 4, 2015

Below is my gulp task.

gulp.task('browserify', function() {
  var b = browserify({
    entries: [path.ENTRY_POINT],
    transform: [reactify],
    debug: true,
    cache: {}, packageCache: {}, fullPaths: false
  });

  var bundle = function () {
    return b.bundle()
      .pipe(source(path.OUTPUT))
      .pipe(gulp.dest(path.DEST))
      .pipe(browserSync.reload({stream: true}))
      .pipe(notify(function () {
        console.log('Bundled successfully!');
      }));
  };

  b = watchify(b);
  b.on('update', function () {
    console.log("Rebundle start...");
    bundle();
  });

  return bundle();
});

When I first run it, everything is OK. Then I changed something, such as change a text to first change, the update event is fired because Rebundle start... is displayed, but I can't see Bundled successfully! in console.

If I changed the text again to second change, then both of the two logs are displayed, but what I see in browser and my bundle file is first change.

I clone the gulp-starter and it has the same issue.

I'm using the browserify v9.0.6 and watchify v3.1.0, is there any usage wrong in the gulp task?

@just4fun
Copy link
Author

just4fun commented Apr 4, 2015

I found the fix here, it was an issue about browserify. v9.0.7 works for me.

@ghost ghost closed this as completed Apr 4, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant