Getting the above error when running gulp.
Can't figure out why. I've read a few things such as the gulp.src needs a ./ infront of app.
var gulp = require('gulp'),
browserify = require('gulp-browserify');
gulp.task('scripts', function () {
gulp.src(['./app/main.js'])
.pipe(browserify({
debug: true,
transform: [ 'reactify' ]
}))
.pipe(gulp.dest('./public/'));
});
gulp.task('default', ['scripts']);
Like so..
I've done a npm install so the node module is is where it should be. Its worth pointing out its called gulp-browserify in the node-module.
As well as I've installed browserify globally on my mac.
Let me know your thoughts or if there is any information im missing.
I'm new to react and trying to literally just set up node.js as a backend and create a react environment.
Getting the above error when running gulp.
Can't figure out why. I've read a few things such as the gulp.src needs a ./ infront of app.
var gulp = require('gulp'),
browserify = require('gulp-browserify');
gulp.task('scripts', function () {
gulp.src(['./app/main.js'])
.pipe(browserify({
debug: true,
transform: [ 'reactify' ]
}))
.pipe(gulp.dest('./public/'));
});
gulp.task('default', ['scripts']);
Like so..
I've done a npm install so the node module is is where it should be. Its worth pointing out its called gulp-browserify in the node-module.
As well as I've installed browserify globally on my mac.
Let me know your thoughts or if there is any information im missing.
I'm new to react and trying to literally just set up node.js as a backend and create a react environment.
Share Improve this question edited Dec 7, 2015 at 15:07 Oss 4,3202 gold badges21 silver badges36 bronze badges asked Dec 7, 2015 at 13:52 Max LynnMax Lynn 1,7786 gold badges25 silver badges35 bronze badges 6- Nice suggestion but that didn't do it. – Max Lynn Commented Dec 7, 2015 at 13:55
- Can you post your plete gulp file? – Gerrit Bertier Commented Dec 7, 2015 at 13:56
- How do you installed that module? – pazitos10 Commented Dec 7, 2015 at 13:57
- 1 "NOTE: THIS PLUGIN IS NO LONGER MAINTAINED" – robertklep Commented Dec 7, 2015 at 13:57
- Gerrit, I've updated the ment with everything i've got in my gulp file. I install the module by doing a npm install – Max Lynn Commented Dec 7, 2015 at 13:57
1 Answer
Reset to default 5gulp-browserify
was blacklisted by gulp
You need to use browserify
with vinyl-source-stream
.
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
gulp.task('browserify', function() {
return browserify({ entries: ["./app/main.js"] })
.bundle()
.pipe(source('main.js'))
.pipe(gulp.dest('./public/')));
});
Read more here.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745135011a4613158.html
评论列表(0条)