browserify / browserify/browserify

Browserify + watchify + babelify. Increase a time of calling and number of times

Open
#1,624 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.7k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hello.

I have some problam with browserify.

```
const appBundle = browserify({
entries: config.client.src.appModule, // main js file
debug: true,
packageCache: {},
cache: {}
}).transform(babelify, {only: './src/client'});

const b = watchify(appBundle);

function rebundle(bundler) {
return bundler
.bundle()
.on('error', function (err) {
gutil.log('Browserify error: ' + gutil.colors.red(err.message));
})
.pipe(source('app.js'))
.pipe(gulp.dest('./dist'));
}

gulp.task('watchify', function () {
rebundle(b);

b.on('update', function () {
rebundle(b)
});
b.on('log', gutil.log); // output build logs to terminal
});

gulp.task('browserify', ['jshint'], function () {
rebundle(appBundle);
});});
```

If use watchify i have after each reload increase the time of reloading and increasing repeating of calling transform.

![2016-09-09 14_47_02-gulp](https://cloud.githubusercontent.com/assets/7432353/18386441/ce00b5a0-769f-11e6-9935-f61e0e0f432a.png)

![2016_09_09_16_09_45_ _gulp](https://cloud.githubusercontent.com/assets/7432353/18387933/1421be28-76a8-11e6-86bf-8646d7f758a4.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.