mozilla-sensorweb / sensorweb-server

Mozilla Public License 2.0
3 stars 6 forks source link

Update Babel configuration to run only the necessary transformations #50

Closed julienw closed 7 years ago

julienw commented 7 years ago

This change makes babel configuration dependant on the node version we use. With node 6 it will only transform ES6 modules to CommonJS modules, because node 6 supports mostly all of modern JavaScript.

Using the env presets makes it very easy to upgrade later and use some new stuff even if Node doesn't support it yet.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.2%) to 85.944% when pulling d091da07aaec5b3b382000684dc96feea2f8fa10 on julienw:babel-upgrade into 71b32cac11d04dce6b3360627478b5b38cb25ae4 on mozilla-sensorweb:master.

julienw commented 7 years ago

Note: I did this patch because I wanted to use co-mocha to make it easier to write asynchronous tests in my other patch. Because this uses generators that mocha changes, I'd would have needed to install babel's polyfills... which is really unneeded in node6 :)

julienw commented 7 years ago

r? @ferjm

julienw commented 7 years ago

@ferjm I can't merge, even accepted PR :)

ferjm commented 7 years ago

lol... you are right, I'll add you as contributor to the repo