I have project using gulp.
I am trying to get jquery, jquery ui and bootstrap into one file called vendor.js.
This works fine however when I run "gulp serve" to run the project fromthe dist folder of the project i get the error
ReferenceError: require is not defined http://localhost:3000/assets/toolkit/scripts/vendor.js Line 6
var jQuery = require('jquery'); gulp.task('vendor-js', function() { return gulp.src(['src/assets/toolkit/scripts/vendor/jquery.min.js', 'src/assets/toolkit/scripts/vendor/jquery-ui.js', 'src/assets/toolkit/scripts/bootstrap/bootstrap.min.js' ]) .pipe(concat('vendor.js')) .pipe(gulp.dest('dist/assets/toolkit/scripts/')); });
Folder Structure
dist\assets\toolkit\scripts dist\assets\toolkit\styles dist\assets\toolkit\images dist\pages index.html
Why is this the case? I have looked all over with no luck! I have seen similar issues but all relating to react?
Can anyone help?
Thanks
NIck