Playframework 2.1预编译ember把手

use*_*159 5 rhino precompile handlebars.js playframework-2.0 ember.js

我正在尝试为PlayFramework 2.1编写一个SBT插件,它可以预编译位于app/assets/templates中的把手模板.我当然会在完成后分享这个插件.我发现这个HOWTO http://eng.netwallet.com/2012/04/25/emberhandlebars-template-precompilation-with-play/这是一个有点过时,但它是适应它玩没问题!2.1.

然后我尝试编译一个简单的模板文件,但SBT失败了以下内容:

ember: processing template test

[error] /.../templates/test.handlebars: Compilation error[unexpected exception during Ember compilation (file=/.../templates/test.handlebars, options=List(), ember=ember-1.0.0-pre.4.js): org.mozilla.javascript.EvaluatorException: missing name after . operator (ember-1.0.0-pre.4.js#3309)]

[error] (MyProject/*:play-copy-assets) @6dap83075: Compilation error in /.../templates/test.handlebars:null

[error] (MyProject/compile:resources) @6dap83075: Compilation error in /.../templates/test.handlebars:null
Run Code Online (Sandbox Code Playgroud)

第3309行的ember-1.0.0-pre.4.js有一个volatile关键字,显然是在Rhino中保留的.

我远非犀牛专家,这就是为什么我想知道是否有人知道如何解决这个问题?我现在不是在寻找5*解决方案.任何解决方案(即使是使用自定义ember.js的快速和肮脏的黑客)都有合理的机会为大多数简单的把手模板工作都可以工作,我们担心一旦功能出现并且SBT插件出来就抛光它.

提前致谢!

flo*_*ain 0

我为 Grails 编写了一个等效的插件。如果我从 rhino 1.7R4 切换到 1.7R2,我会得到完全相同的错误。您必须切换到 org.mozilla:rhino:1.7R4。

如果您遇到更多问题,我建议您查看我的源代码。您可以从这里开始: https: //github.com/florent-blanvillain/grails-ember-templates-precompiler/blob/master/src/groovy/org/grails/plugin/ember/handlebars/Precompiler.groovy

干杯