casbloem / vue-luxon

Easy use of datetime with Luxon in Vue
https://npmjs.com/package/vue-luxon
72 stars 8 forks source link

Error during build #3

Closed rajagopalx closed 6 years ago

rajagopalx commented 6 years ago

I m using vue cli 2 to create application. During build process I am getting

ERROR in static/js/vendor.f66189cd88822a0ceea7.js from UglifyJs
Unexpected token: punc ({) [./node_modules/vue-luxon/vue-luxon.js:1,0][static/js/vendor.f66189cd88822a0ceea7.js:68134,4]
casbloem commented 6 years ago

Try to add the babel-preset-es2015 dependency to fix this.

more info: https://babeljs.io/docs/plugins/preset-es2015/

rajagopalx commented 6 years ago

In dev dependency, "babel-preset-es2015": "^6.24.1". But still error occurs.

casbloem commented 6 years ago

Did you enable it?

aaronpeterson commented 6 years ago

Same here, btw. I can't seem to get webpack to babel-load any es6 npm modules. Curious if anyone ever figures it out. The problem is that babel-loader is usually set to ignore node_modules/. One can make exceptions but webpack needs a way to know what is es6 and what isn't. Since it can't tell, it assumes node_modules/ is es5 and pipes it to uglify.

The solution is somewhat tedious and requires excluding package by package like so -- the 43 ups here must have a lot of free time.

My guess is that this is why most npm packages I see with src in es6 still transpile main distributions to es5.