gruntjs - Converting a grunt browserify task to gulp -


i trying convert old grunt task gulp. task uses browserify:

browserify: {     options: {         transform: [ require('grunt-react').browserify ]     },     client: {         src: ['react/**/*.jsx'],         dest: 'public/js/browserify/bundle.js'     } } 

i have following plugins loaded in gulpfile.js:

var gulp = require('gulp'); var browserify = require('browserify'); var reactify = require('reactify'); var source = require("vinyl-source-stream"); 

how can create same task in gulp using browserify reactify transform?

you'll want along these lines:

gulp.task('whatever', function () {   return browserify({     entries: [...]   })     .transform(reactify, { /* opts if */ })     .bundle()     .pipe(source('bundle.js'))     .pipe(gulp.dest('public/js/browserify')); }); 

but if need glob entry files, you'll need pull in globbing module , use generate list (array) pass browserify entry files.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -