var $ = require('jquery'); var owl = require('owl.carousel'); module.exports = function(selector){ return $(selector).owlCarousel(); }; owl('.owl-carousel'); 

In the console I see an error of the form: bundle.js:11899 Uncaught TypeError: Cannot read property 'fn' of undefined

How to do it right?

    1 answer 1

    Understood, guys if anyone uses browserify and will be requesting jquery-dependent plugins, in your main file write global.jQuery = require('jquery');

    • In my experience this was not enough. It only global.jQuery = global.$ = require('jquery'); when global.jQuery = global.$ = require('jquery'); - Sergey Mell