这是我当前的 Play 2.2.x requireJS 设置。 2.3之后还能继续用吗?我在 2.3 文档中找不到 requireJs 或 requireJsShim 。
requireJs ++= Seq("mainAccount.js", "mainOrg.js", "mainPublic.js"), // This tells Play to optimize this file and its dependencies
requireJsShim += "build.js", // This tells Play to read the RequireJS "shim" configuration from build.js
requireJsFolder := "js"
-
代替requireJs
use:
RjsKeys.modules := Seq(
WebJs.JS.Object("name" -> "mainAccount"),
WebJs.JS.Object("name" -> "mainOrg"),
WebJs.JS.Object("name" -> "mainPublic")
)
代替requireJsShim
use
RjsKeys.mainConfig := "build"
- 我想你可以省略
requireJsFolder
as baseUrl
被认为是js
or javascripts
默认情况下。看这里:https://github.com/sbt/sbt-rjs/blob/master/src/main/scala/com/typesafe/sbt/rjs/SbtRjs.scala#L104 https://github.com/sbt/sbt-rjs/blob/master/src/main/scala/com/typesafe/sbt/rjs/SbtRjs.scala#L104如果您想更改为其他内容,请使用RjsKeys.baseUrl := "your-js-dir-name"
还有一个使用 RequireJS 的 github 项目已迁移到 Play 2.3,可能也很有用:https://github.com/mariussoutier/play-angular-require-seed https://github.com/mariussoutier/play-angular-require-seed
有关更多详细信息,请查看 sbt-rjs 插件文档:https://github.com/sbt/sbt-rjs https://github.com/sbt/sbt-rjs
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)