I am having problems implementing requirejs in Play 2.0, where in dev mode all modules can be found, but when I run dist, it seems that the paths that I have installed are not being followed.
Here is the setup:
/assets/javascripts/templates/template1/main.js:
require.config({ baseUrl: "/assets/javascripts", paths : { jquery : [ 'core/lib/jquery/jquery-1.8.3' ], can : [ 'core/lib/canjs/can' ] } }); require([ "jquery", "can", "core/global/moduleloader" ], function($, can, ml) {
And in the template I call:
@helper.requireJs(core = routes.Assets.at("javascripts/require.js").url, module = routes.Assets.at("javascripts/templates/template1/main").url)
in my build.scala I tell you which files to optimize like this:
val main = play.Project(appName, appVersion, appDependencies).settings( requireJs += "templates/template1/main" )
Client side all dependencies are allowed, but when using dist for optimization, I get:
[info] RequireJS optimization has begun... [info] app.build.js: [info] ({appDir: "javascripts", [info] baseUrl: ".", [info] dir:"javascripts-min", [info] modules: [{name: "templates/template1/main"}]}) model contains 41 documentable templates Tracing dependencies for: templates/template1/main JavaException: java.io.FileNotFoundException: /Users/paulsmith/Projects/Experiments/play/Moduluar/target/scala-2.10/classes/public/javascripts-min/jquery.js (No such file or directory) In module tree: templates/template1/main
From what I see, the config path is ignored and therefore it resolves the paths incorrectly. this seems to be due to app.build.js overriding the configuration in main.js.
Has anyone encountered this problem before?
Thanks,
Floor