ECMAScript:Harmony / ES6 to JavaScript compiler

后端 未结 8 944
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 13:37

After reading Peter\'s article on JavaScript I noticed

Brendan Eich stated that one the goals for Harmony is to be a better target for to-JavaScript c

8条回答
  •  佛祖请我去吃肉
    2020-12-12 14:23

    Google Closure Compiler (Github) is a great tool for ES6 compilation. It's a simple Java jar that is used from the command line. There are other options such as API services and GUIs, but I find that it was best to set up an automatic build system hooking into the Java JAR. It can transpile your ES6 code into ES5 compatible code. I started using it for compressing and obfuscating code, but it can also do error checking and the ES6 transpilation as I mentioned.

    Note that the ES6 features are marked as experimental. But I'm planning on using them in production soon, since my tests were rock solid.

提交回复
热议问题