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
厚积薄发,笨鸟先飞。