[英]Should I use Babel for a Node.js server app or not? and why?
I love ES6 syntax and this new object oriented stylish approach, which is easier for me to code that way. 我喜欢ES6语法和这种新的面向对象的时尚方法,这种方法对我来说更容易编码。 But it's just a preference, because I'm new to JavaScript.
但这只是一个偏好,因为我是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!
我只是想了解在未来的性能(如果有)和维护,可读性等方面使用Babel的优缺点。...谢谢!
Seems like a duplicate. 好像是重复的。 Is it okay to use babel-node in production
在生产中使用babel-node可以吗
You could use babel-node in development, and then transpile your ES6 to ES5 for production if you are worried about performance. 您可以在开发中使用babel-node,然后在担心性能的情况下将ES6转换为ES5进行生产。
ES6 syntax will be supported for the foreseeable future. 在可预见的将来,将支持ES6语法。 That is the nature of standards.
这就是标准的本质。
A common reason Babel is frequently involved in the build process for Node webapps is that Babel allows us to easily compile ES6 code to older versions (usually ES5), because it has better browser support. Babel经常参与Node webapps的构建过程的一个常见原因是Babel允许我们轻松地将ES6代码编译为旧版本(通常是ES5),因为它具有更好的浏览器支持。
For a purely server-side app, there is no reason, other than maybe slight performance gains, to compile to ES5. 对于纯粹的服务器端应用程序,除了可能会有一点性能提升之外,没有其他理由可以编译到ES5。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.