1

I have a project using Play 2.2 and am attempting to upgrade it to Play 2.3.

As part of the build process, we used a custom RequireJS config file "build.js" imported using the option "requireJsShim" in our Build.scala file.

val myProject = Project("MyProject" ....).settings(
    requireJsShim += "build.js"
)

This correctly used the configuration file "/app/assets/javascripts/build.js for the RequireJS compilation stage.

However after upgrading to Play 2.3, I'm getting the following error

/target/scala-2.10/classes/public/javascripts/build.js does not exist

It appears requireJsShim is looking for the file here, however the new SbtWeb build pipeline is instead placing it here

/skedulo/target/web/rjs/build/javascripts/build.js

The requireJsShim option no longer appears to be a documented configuration parameter, and the new options as part of the RJS pipeline don't seem to cover the same use-case. Is there a way of having requireJsSim support in Play 2.3?

James Davies
  • 9,602
  • 5
  • 38
  • 42

1 Answers1

1

Instead of requireJsShim use RjsKeys.mainConfig := "build"

Also check my answer to a similar question. I've put more information there: Play 2.3 requireJs optimization and shim for multiple modules

Community
  • 1
  • 1
lagivan
  • 2,689
  • 22
  • 30