I'm using elixir and I can't get to work any JS using JQuery I keep getting this :
var jQuery = require('jquery'); //Uncaught ReferenceError: require is not defined
Here is my elixir function:
elixir(function(mix) {
mix.sass('app.scss');
mix.copy('node_modules/font-awesome/fonts', 'public/fonts');
mix.copy('node_modules/bootstrap-sass/assets/fonts', 'public/fonts');
mix.copy(['node_modules/bootstrap-sass/assets/javascripts/bootstrap.js',
'node_modules/jquery/dist/jquery.js',
'node_modules/jquery-ui/jquery-ui.js',
'node_modules/fullcalendar/node_modules/moment/moment.js',
'node_modules/fullcalendar/dist/fullcalendar.js',
'node_modules/fullcalendar/dist/gcal.js',
'node_modules/dropzone/dist/dropzone.js',
'node_modules/jquery-datetimepicker/jquery.datetimepicker.js'
], 'resources/assets/js/vendors');
mix.copy('resources/assets/js/vendors/jquery.js', 'public/js');
// mix.copy('resources/assets/js/vendors/jquery-ui.js', 'public/js');
// mix.copy('resources/assets/js/vendors/bootstrap.js', 'public/js');
mix.scripts(['vendors/jquery-ui.js',
'vendors/bootstrap.js',
'vendors/contentflow.js',
'vendors/qTip/jquery.qtip.min.js',
'vendors/moment.js',
'vendors/fullcalendar.js',
'vendors/dropzone.js',
'vendors/jquery.datetimepicker.js'
], 'public/js/vendors.js');
mix.scripts(['date-time-pickers.js',
'main.js',
'search-page.js',
'social.js',
'booking-picker.js'
], 'public/js/app.js');
});
Any idea what happens? Tried
mix.browsesify
but it would return
[Laravel Elixir] Browserify Failed!: Cannot find module 'moment'``
Thanks for your help!