drewjbartlett / vue-flickity

A Vue Slider / Carousel Component for Flickity.js
http://drewjbartlett.com/demos/vue-flickity/
374 stars 55 forks source link

Webpack minification fail with pre-ES6 code #25

Closed wmcmurray closed 6 years ago

wmcmurray commented 7 years ago

Hi :raised_hand_with_fingers_splayed: , when I tried to minify my project (which does NOT contain any ES6 syntax), I still had an error looking like there is ES6 syntax somewhere... :

ERROR in app/public/javascripts/all.js from UglifyJs
Unexpected token punc «(», expected punc «:»

I couldn't understand why, until I found out it was caused by this module being in ES6 !

I'll probably just copy your flickity.vue file into my project and fix it with "old school" syntax so the solution is simple.

But I wrote this issue anyway to check if you plan to do something about it ? :slightly_smiling_face: ...and to leave traces of this on the internetsss, in case it helps someone !

wopian commented 6 years ago

UglifyJS still can't handle most of the ES2015+ syntax. You can switch it out with uglify-es (which is published from the harmony branch of UglifyJS) and will then be minified without issues 👌

drewjbartlett commented 6 years ago

Closing this :)