w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Reactify, Browserify and Gulp: TypeError: Object # has no method 'transform'

There is some problems with your task.

First, you have to use gulp.src to get your main.js file. Second, transform is an option of gulp-browserify, not something you want to pipe your stream on, same for bundle.

gulp.task('scripts', function () {
  return gulp.src('./assets/js/main.js')
    .pipe(browserify({
      transform: [reactify]
    }))
    .pipe(gulp.dest('./static/js'));
});

If you want something that is more like your first attempt, you don't need gulp-browserify, but browserify alone, there is a quite good article on how to use ReactJs with Browserify and gulp here.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.