playframework 2.3 - Play 2.3 requireJs optimization and shim for multiple modules -


this current setup play 2.2.x requirejs. continue work after 2.3? can't find requirejs or requirejsshim anywhere in 2.3 documentation.

  requirejs ++= seq("mainaccount.js", "mainorg.js", "mainpublic.js"), // tells play optimize file , dependencies   requirejsshim += "build.js", // tells play read requirejs "shim" configuration build.js   requirejsfolder := "js" 

  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 can omit requirejsfolder baseurl considered either js or javascripts default. see here: https://github.com/sbt/sbt-rjs/blob/master/src/main/scala/com/typesafe/sbt/rjs/sbtrjs.scala#l104 if want change else, use rjskeys.baseurl := "your-js-dir-name"

also there github project using requirejs migrated play 2.3, may useful well: https://github.com/mariussoutier/play-angular-require-seed

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


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -