I am trying to use the jQuery plugin of SwiperJS in my Browserify bundle...but get the following error:
Uncaught TypeError: $(...).swiper is not a function
The stripped down (bear minimal) code I am using is as follows:
'use strict';
global.$ = require('jquery');
require('./plugins/swiper.jquery.js');
$(function() {
$('#hero').swiper();
});
At the bottom of the SwiperJS plugin they do:
if (typeof(module) !== 'undefined')
{
module.exports = window.Swiper;
}
else if (typeof define === 'function' && define.amd) {
define([], function () {
'use strict';
return window.Swiper;
});
}
Which seems to correctly set it up for this use.
Can anybody help me with why this is happening? Probably something very simple I'm sure.