Durandal Weyland optimizations doesn't handle the require function

93 views Asked by At

I've found out that weyland optimizer replaces the paths in the javascript files with their real values. But it doesn't replace the paths used in middle of the code using require function.

For example:

require('myscripts/mymodule', function(mymodule){
    // do something after mymodule is ready.
}

and I'm defined myscripts as a path like:

'myscripts': 'api/ScriptHandler/GetModule'
1

There are 1 answers

0
Louis On BEST ANSWER

RequireJS' optimizer needs its build file to have findNestedDependencies: true to find such cases. If Weyland uses RequireJS' optimizer behind the scenes (ETA: it does) this might be the solution.