只为成功找方法,不为失败找理由。

博客园 首页 新随笔 联系 订阅 管理
What you did
I have installed Swiper as normal dependency in my Project and import it to my scripts file like this import Swiper from 'swiper';
If I try to bundle it to a production ready version with webpack i get this error

Unexpected token: name (Dom7) [./node_modules/dom7/dist/dom7.modular.js:14,0][js/vendor.a8b881e4dc98829fb5c4.js:36577,6]

ERROR in js/vendor.a8b881e4dc98829fb5c4.js from UglifyJs
Unexpected token: name (Dom7) [./node_modules/dom7/dist/dom7.modular.js:14,0][js/vendor.a8b881e4dc98829fb5c4.js:36577,6]
as soon as I downgrade Swiper to version 3.4.2 everything works as expected.

Expected Behavior
Bundling and compression via webpack is working

Actual Behavior
UglifyJS throws an error because of dom7

 降级swiper版本 到3.4.2

posted on 2018-04-25 11:52  诗意的活着  阅读(3517)  评论(0编辑  收藏  举报