I feel like using Babel on the server side is more trouble than it’s worth
Probably an unpopular opinion, but hear me out. I love what Babel allows us to do on the client side. But with the advancements we've seen in Node up to v8, things like async/await and native promises being available, I find the only thing I'm missing out on is ES6 module import /export syntax. There are other things probably, but nothing I'm really missing.
I don't find it to be too bad of a tradeoff to lose out on that in order to avoid the build configuration that I need to fit my workflow. I need to use babel-node to run the code in development. Fine, that's not so bad. But then I need to build a production Docker image, and in order to do that without including Dev dependencies in the image, I would have to configure a second Docker image — a builder image. It's taking me into configuration hell, so I usually just decide to suck it up and write require instead of import.
So that's where I'm at. When I switch between back end and front end, I do miss the eloquence of the import /export syntax, but I haven't found a way to circumvent the issues described.
I would love to hear your take on the matter, and if you have solved this issue yourself I'd love to be shown the way.
Submitted July 15, 2017 at 09:38PM by wheezy360
via reddit http://ift.tt/2te6xi4