For whatever reason, my browserify and gulp stopped working. For example, here's my gulp js script to bundle 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(streamify(uglify()))*/ .pipe(gulp.dest('.')) .pipe(notify({ message: 'JavaScript has been bundled with Browserify!'})); // .pipe(livereload()); }); and here is main.js:
var ajaxChng = require('./ajax-changelog'); ajaxChng(); and inside src/js/ajax-changelog.js is this:
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; // Unhandled 'error' event ^ SyntaxError: Unexpected token ... what am I doing wrong?
events.js:<some line>\n throw err; // unhandled 'error' event\n ^\n SyntaxError: Unexpected tokenno matter what the actual source code is.