Browserify FullCalendar with external jQuery Browserify FullCalendar with external jQuery javascript javascript

Browserify FullCalendar with external jQuery


I was able to get it working by changing require('jquery') in the fullcalendar factory to $.

Also, no need to use import $ from 'jquery' in your index.js file. It is already a dependency in the fullcalendar npm.

After running

browserify index.js -t babelify -x jquery > index.min.js

Edit the index.min.js file in the fullcalendar factory function where it reads:

else if(typeof exports === 'object') {    module.exports = factory(require('jquery'), require('moment'));}

to:

else if(typeof exports === 'object') {    module.exports = factory($, require('moment'));}

Alternately, you could make this edit directly in the node_modules/fullcalendar/dist/fullcalendar.js file.

I hope this helps!