获取jQuery插件mCustomScrollbar不是Webpack设置中的函数错误
我们的前端开发环境是Gulp/jQuery,正在尝试将其迁移到Webpack上。运行新设置时,浏览器显示jquery.mCustomScrollbar插件的以下控制台错误:获取jQuery插件mCustomScrollbar不是Webpack设置中的函数错误,webpack,mcustomscrollbar,Webpack,Mcustomscrollbar,我们的前端开发环境是Gulp/jQuery,正在尝试将其迁移到Webpack上。运行新设置时,浏览器显示jquery.mCustomScrollbar插件的以下控制台错误: Uncaught (in promise) TypeError: $cartList.mCustomScrollbar is not a function 我们已尝试在主捆绑包中通过以下方式导入,但仍然无法正常工作: // minified file require("source/js/vendor/jquery.mCu
Uncaught (in promise) TypeError: $cartList.mCustomScrollbar is not a function
我们已尝试在主捆绑包中通过以下方式导入,但仍然无法正常工作:
// minified file
require("source/js/vendor/jquery.mCustomScrollbar.concat.min.js");
// and npm packages
require('../core/jquery.mousewheel.js');
require('../core/jquery.mCustomScrollbar');
虽然我们找不到任何解决方案,但Github用户swarty在以下链接中的评论帮助我们解决了这个问题,在McCustomsCrollBar插件代码中注释了一些代码: