I am trying to use gulp and browserify to transform my .jsx
files into .js
files.
var gulp = require('gulp');
var browserify = require('browserify');
var reactify = require('reactify');
gulp.task('js', function () {
browserify('public/javascripts/src/app.jsx')
.transform(reactify)
.bundle()
.pipe(gulp.dest('public/javascripts/dist'))
});
```
The above threw Arguments to path.resolve must be strings
. I managed to get around it by using vinyl-source-stream
var source = require('vinyl-source-stream');
...
.bundle()
.source('app.js')
...
Why does this work? I am fairly new to nodejs and gulp. After reading the README of the project and the source code, I am still confused. Any help?