Last active
August 29, 2015 14:12
-
-
Save moredip/14f69be3a45e11b2a36d to your computer and use it in GitHub Desktop.
gulp, browserify, reactify, and sadness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//based on https://medium.com/@sogko/gulp-browserify-the-gulp-y-way-bb359b3f9623 | |
var gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var transform = require('vinyl-transform'); | |
var reactify = require('reactify'); | |
gulp.task('browserify', function () { | |
var browserified = transform(function(filename) { | |
var b = browserify(filename); | |
return b.bundle(); | |
}); | |
return gulp.src(['./js/app.js']) | |
.pipe(browserified) | |
.pipe(gulp.dest('./build')); | |
}); | |
gulp.task('browserify-with-reactify-transform', function () { | |
var browserified = transform(function(filename) { | |
var b = browserify(filename); | |
b.transform('reactify'); // <--- this makes things go boom. | |
return b.bundle(); | |
}); | |
return gulp.src(['./js/app.js']) | |
.pipe(browserified) | |
.pipe(gulp.dest('./build')); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pete@clyde: ~/git/react-cards (master *+) | |
⋙ gulp browserify | |
[15:07:26] Using gulpfile ~/git/react-cards/gulpfile.js | |
[15:07:26] Starting 'browserify'... | |
[15:07:28] Finished 'browserify' after 2.26 s | |
pete@clyde: ~/git/react-cards (master *+) | |
⋙ gulp browserify-with-reactify-transform | |
[15:07:35] Using gulpfile ~/git/react-cards/gulpfile.js | |
[15:07:35] Starting 'browserify-with-reactify-transform'... | |
events.js:72 | |
throw er; // Unhandled 'error' event | |
^ | |
Error: write after end | |
at writeAfterEnd (/Users/pete/git/react-cards/node_modules/browserify/node_modules/labeled-stream-splicer/node_modules/stream-splicer/node_modules/readable-stream/lib/_stream_writable.js:161:12) | |
at Labeled.Writable.write (/Users/pete/git/react-cards/node_modules/browserify/node_modules/labeled-stream-splicer/node_modules/stream-splicer/node_modules/readable-stream/lib/_stream_writable.js:208:5) | |
at /Users/pete/git/react-cards/node_modules/browserify/index.js:251:27 | |
at Array.forEach (native) | |
at resolved (/Users/pete/git/react-cards/node_modules/browserify/index.js:250:28) | |
at /Users/pete/git/react-cards/node_modules/browserify/index.js:282:13 | |
at /Users/pete/git/react-cards/node_modules/browserify/node_modules/resolve/lib/async.js:48:21 | |
at /Users/pete/git/react-cards/node_modules/browserify/node_modules/resolve/lib/async.js:127:35 | |
at /Users/pete/git/react-cards/node_modules/browserify/node_modules/resolve/lib/async.js:99:39 | |
at /Users/pete/git/react-cards/node_modules/browserify/node_modules/resolve/lib/async.js:65:30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah... browserify/browserify#1044 seems to be a discussion of this issue.