最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Should I use Babel for a Node.js server app or not? and why? - Stack Overflow

programmeradmin3浏览0评论

I love ES6 syntax and this new object oriented stylish approach, which is easier for me to code that way. But it's just a preference, because I'm new to JavaScript. I just want to know the pros and cons of using Babel in terms of performance (if any) and maintenance in the future, readability, etc.... Thank y'all!

I love ES6 syntax and this new object oriented stylish approach, which is easier for me to code that way. But it's just a preference, because I'm new to JavaScript. I just want to know the pros and cons of using Babel in terms of performance (if any) and maintenance in the future, readability, etc.... Thank y'all!

Share Improve this question edited Mar 2, 2018 at 7:19 Clomp 3,3182 gold badges25 silver badges38 bronze badges asked Feb 28, 2018 at 23:46 Bryan A. Trinidad CarreroBryan A. Trinidad Carrero 491 silver badge4 bronze badges 0
Add a ment  | 

2 Answers 2

Reset to default 4

ES6 syntax will be supported for the foreseeable future. That is the nature of standards.

A mon reason Babel is frequently involved in the build process for Node webapps is that Babel allows us to easily pile ES6 code to older versions (usually ES5), because it has better browser support.

For a purely server-side app, there is no reason, other than maybe slight performance gains, to pile to ES5.

Seems like a duplicate. Is it okay to use babel-node in production

You could use babel-node in development, and then transpile your ES6 to ES5 for production if you are worried about performance.

发布评论

评论列表(0)

  1. 暂无评论