我正在尝试根据https://play.lighthouseapp.com/projects/82401/tickets/193-javascript-require-support-in-non-minimized-files的说明修改闭包编译器选项。
我还需要添加一个解析器。
val defaultOptions = new CompilerOptions()
defaultOptions.closurePass = true
CompilationLevel.WHITESPACE_ONLY.setOptionsForCompilationLevel(defaultOptions)
defaultOptions.setProcessCommonJSModules(true)
val root = new java.io.File(".")
defaultOptions.setCommonJSModulePathPrefix(root.getCanonicalPath + "/app/assets/javascript/")
defaultOptions.setPrettyPrint(true)
def optClosureValues = Option(System.getProperty("closureoff")).filter(_ != "").map {
dev =>
println("using alternative closure compiler")
closureCompilerSettings(defaultOptions)
}.getOrElse(Seq.empty)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
optClosureValues:_*,
resolvers += ("Morphia" at "http://morphia.googlecode.com/svn/mavenrepo/")
)
这给出了一个错误
Build.scala:35: no `: _*' annotation allowed here
[error] (such annotations are only allowed in arguments to *-parameters)
[error] optClosureValues:_*,
[error] ^
[error] one error found
这里的正确语法是什么?