For some reason my browserifyand gulpstopped working. For example, here is my gulp jsscript for linking my javascript.
gulp.task('js', function() {
gulp.src('src/js/*.js')
.pipe(plumber())
.pipe(gulp.dest('js'));
return browserify('./src/js/main', { debug: true })
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('.'))
.pipe(notify({ message: 'JavaScript has been bundled with Browserify!'}));
});
and here main.js:
var ajaxChng = require('./ajax-changelog');
ajaxChng();
and inside src/js/ajax-changelog.js:
module.exports = {
console.log('Hello World');
};
But when I do gulp js, I get:
λ gulp js
[19:11:50] Using gulpfile c:\wamp\www\osrsmap\gulpfile.js
[19:11:50] Starting 'js'...
events.js:85
throw er;
^
SyntaxError: Unexpected token
... what am I doing wrong?
source
share