I’m trying to do this
var $ = require('jquery');
$("document").ready(function() {
console.log('hello world');
});
It’s not working. The console logs an error of
script.js:2 Uncaught TypeError: Cannot read property 'fn' of undefined
This is the gulp task responsible for the js file
gulp.task('js', function() {
gulp.src( path.to.jsOriginalFiles ) //Get all these files
.pipe(concat('script.js')) //and concat them into scrip.js
.pipe(browserify())
.pipe(gulpif(path.to.env !== 'development', uglify() ) )
.pipe(gulp.dest(path.to.jsDistFiles))
.pipe(browserSync.stream())
});
Thanks for your help