This is tad long but I\'ll need the code example to illustrate my confusion. After which I am interested to the answer for the following:
re
I think the absolute best way to go is, as Sebastien Lorber notes, with setting the path in your calling of browserify through a pipe.
But with the latest version of browserify, (as of this moment, that is browserify@11.0.0
) the path variable stores the only paths that Browserify will use for its process. So setting the paths variable will exclude say... your global folders for node, as far as I can tell. As a result, you'll need a Gulp task that looks sort of like this:
gulp.task('reactBuild', function() {
return gulp.src(newThemeJSX)
.pipe(browserify({
debug: true,
extensions: ['.jsx', '.js', '.json'],
transform: [reactify],
paths: ['../base_folder/node_modules', '/usr/lib/node_modules']
}))
.pipe(gulp.dest(newThemeBuilt))
.on('error', function(error) {
console.log(error);
});
});