Play framework ES6->ES5 transpiler?

2019-07-08 08:55发布

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条回答
别忘想泡老子
2楼-- · 2019-07-08 09:39

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

查看更多
登录 后发表回答