Play framework ES6->ES5 transpiler?

蹲街弑〆低调 提交于 2019-12-12 20:20:02

问题


Is there an easy way to set up Play Framework (2.4.x, the current stable version) to transpile ES6 assets to ES5 on the fly, similar to how you can set it up to use the closure compiler to minify Javascript?


回答1:


sbt-web is the place to go when you need anything related to build client side assets in Playframework projects. There is a plugin listed that maybe can solve your problem: sbt-traceur. This plugin uses traceur-compiler to transpile ES6 assets to ES5.

Edit:

Apparently, there is also an unlisted plugin that uses BabelJS:

https://github.com/stonexx/sbt-babeljs



来源:https://stackoverflow.com/questions/34713267/play-framework-es6-es5-transpiler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!