Play 2.3 requireJs optimization and shim for multiple modules

依然范特西╮ 提交于 2019-12-05 12:40:59
  1. Instead of requireJs use:

    RjsKeys.modules := Seq(
        WebJs.JS.Object("name" -> "mainAccount"),
        WebJs.JS.Object("name" -> "mainOrg"),
        WebJs.JS.Object("name" -> "mainPublic")
    )
    
  2. Instead of requireJsShim use RjsKeys.mainConfig := "build"

  3. I think you can just omit requireJsFolder as baseUrl is considered to be either js or javascripts by default. See here: https://github.com/sbt/sbt-rjs/blob/master/src/main/scala/com/typesafe/sbt/rjs/SbtRjs.scala#L104 If you want to change to something else, then use RjsKeys.baseUrl := "your-js-dir-name"

Also there is a github project using RequireJS that was migrated to Play 2.3, may be useful as well: https://github.com/mariussoutier/play-angular-require-seed

For more details check sbt-rjs plugin docs: https://github.com/sbt/sbt-rjs

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