How to get jScrollPane from node_modules
leonziger opened this issue · comments
Please advice me how to import jScrollPane from node-modules?
I try to do:
window.$ = window.jQuery = require('jquery');
import '../node_modules/jscrollpane/script/mwheelintent';
import '../node_modules/jscrollpane/script/jquery.mousewheel';
import '../node_modules/jscrollpane/script/jquery.jscrollpane';
$('.my-block').jScrollPane();
I have a mistake:
Uncaught ReferenceError: jQuery is not defined
at Object.6 (mwheelintent.js:76)
at o (_prelude.js:1)
at _prelude.js:1
at Object.8.../node_modules/jscrollpane/script/jquery.jscrollpane (app.js:2)
at o (_prelude.js:1)
at r (_prelude.js:1)
at _prelude.js:1
Thanks for your help
Hello nice question. Problem is that I don't use NPM package I just packit as people seems to like use it but according to internet (https://stackoverflow.com/questions/36509397/node-js-jquery-referenceerror-is-not-defined-error-how-do-i-use-jquery) I assume it should be like:
$ = jQuery = require('jquery')(window);
If it's not I have to eat my own dog food and test this npm package how it works. Can you provide minimal not working code if this ain't the way to fix it for debugging.