Skip to content

Commit

Permalink
add note about handling stream errors
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Apr 1, 2015
1 parent 3673caf commit 359dece
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/recipes/browserify-uglify-sourcemap.md
Expand Up @@ -4,6 +4,8 @@
tool but requires being wrapped before working well with gulp. Below is a simple recipe for using
Browserify with transforms and full sourcemaps that resolve to the original individual files.

See also: the [Combining Streams to Handle Errors](https://github.com/gulpjs/gulp/blob/master/docs/recipes/combining-streams-to-handle-errors.md) recipe for handling errors with browserify or uglify in your stream.

``` javascript
'use strict';

Expand All @@ -15,12 +17,12 @@ var sourcemaps = require('gulp-sourcemaps');
var gutil = require('gulp-util');

gulp.task('javascript', function () {
// transform regular node stream to gulp (buffered vinyl) stream
// transform regular node stream to gulp (buffered vinyl) stream
var browserified = transform(function(filename) {
var b = browserify({entries: filename, debug: true});
return b.bundle();
});

return gulp.src('./app.js')
.pipe(browserified)
.pipe(sourcemaps.init({loadMaps: true}))
Expand Down

0 comments on commit 359dece

Please sign in to comment.