Play 2.3 requires optimization and laying of several modules

This is my current setup for Play 2.2.x requireJS. Will it continue to work after 2.3? I cannot find requireJs or requireJsShim anywhere in the 2.3 documentation.

  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"
+4
source share
1 answer
  • requireJsUse instead :

    RjsKeys.modules := Seq(
        WebJs.JS.Object("name" -> "mainAccount"),
        WebJs.JS.Object("name" -> "mainOrg"),
        WebJs.JS.Object("name" -> "mainPublic")
    )
    
  • requireJsShimUse insteadRjsKeys.mainConfig := "build"

  • I think you can just omit it requireJsFolder, since baseUrlthe default is jseither or javascripts. 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 something else, useRjsKeys.baseUrl := "your-js-dir-name"

github RequireJS, Play 2.3, : https://github.com/mariussoutier/play-angular-require-seed

. sbt-rjs: https://github.com/sbt/sbt-rjs

+7

Source: https://habr.com/ru/post/1546069/


All Articles