be-fe / iSlider

Smooth mobile touch slider for Mobile WebApp, HTML5 App, Hybrid App
http://be-fe.github.io/iSlider/
MIT License
1.66k stars 448 forks source link

修复plugin在使用npm安装时无法引用的bug #442

Closed guoyueting closed 6 years ago

guoyueting commented 6 years ago

iSlider的plugin全局能用,npm包不能用的问题。 Bug描述:npm安装后根据package.json的main配置,入口文件是build/index.bundle.js,但实际上plugins中使用require('./iSlider')的引用方式只能调用src/js/iSlider.js中的plugin,因此会出现采用npm时二者不一致的情况。 解决方案:将plugins插件中的引用iSlider组件的代码由require('./iSlider')改为require('islider.js'),这样无论是全局还是npm,都能引用正确的iSlider组件。