Hy there
I'm new to Webpack or JS-bundel in general. So this question might sound dumb. If so, I'm sorry..
I'm using webpack to bundle all JS files. So far I have this im main.js
:
var jQuery = require('jquery');
var autogrow = require('jquery.ns-autogrow');
(function($){
$(function(){
$('textarea').autogrow();
});
})(jQuery);
But now I get Uncaught TypeError: Cannot read property 'fn' of undefined
right at the beginning of the ns-autogrow plugin/module.
(function($, window) {
return $.fn.autogrow = function(options) { ...
Is there something I made wrong requiring the dependencies?
You have to include jquery dependency at the global scope of your app to use it this way :
To do it, you should use something like :
you can see more details at this address
I hope it may help