question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't play nicely with Webpack

See original GitHub issue

This library doesn’t work with Webpack without overrides. In particular, jquery-mousewheel doesn’t get required properly,

From what I can tell, this is because, jquery-mousewheel is only required when RequireJS is deemed not present.

However, in the Webpack supports both the CommonJS and AMD formats, so this prevents the import of jquery-mousewheel.

In addition require("jquery-mousewheel")($) won’t work if using Webpack, because, again, jquery-mousewheel will think we’re using AMD in this situation.

(#306 might be relevant.)

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:3
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
swartycommented, Oct 10, 2019

try to resolve this problem in webpack, i am comment some lines in mCustomSrollBar.js file.

Problem consist of that file cant find route to node_modules folder for load mousewheel file, so there is a fast solution:

function(init){
    var _rjs=typeof define==="function" && define.amd, /* RequireJS */
        _njs=typeof module !== "undefined" && module.exports, /* NodeJS */
        _dlp=("https:"==document.location.protocol) ? "https:" : "http:", /* location protocol */
        _url="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";
    $.event.special.mousewheel || $("head").append(decodeURI("%3Cscript src="+_dlp+"//"+_url+"%3E%3C/script%3E"));

    // if(!_rjs){
        // if(_njs){
        //  require("jquery-mousewheel")($);
        // }else{
        //  /* load jquery-mousewheel plugin (via CDN) if it's not present or not loaded via RequireJS 
        //  (works when mCustomScrollbar fn is called on window load) */

        // }
    // }
    init();
}
2reactions
wzupcommented, Jun 5, 2016

Seven month left from the date the issue appeared here. Any support for Webpack?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Doesn't play nice with Webpack · Issue #93 - GitHub
I use Webpack with Node because it's a simpler way to use Babel, bundle node_modules and minify code. webpack.config.js : const path =...
Read more >
Developers - Doesn't play nicely with Webpack - - Bountysource
Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support etc.
Read more >
Mobx-react doesnt play nicely with webpack and typescript
In my .tsx file I import observer like that: import { observer } from "mobx-react". and am getting error: ERROR in .
Read more >
React Testing: Getting jest to play nicely with webpack static ...
Turns out it was fine before, but now since the css is imported in the component file, jest does not know what to...
Read more >
Module Bundling with Webpack - LearnHowToProgram.com
Not all packages play nicely with every version of all other packages. ... Once that code is published online, Webpack doesn't need to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found