0

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'
mehrandvd
  • 8,806
  • 12
  • 64
  • 111
  • possible duplicate of [Durandal weyland optimizations doesn't work while using multiple projects](http://stackoverflow.com/questions/20440302/durandal-weyland-optimizations-doesnt-work-while-using-multiple-projects) – PW Kad Dec 07 '13 at 17:31
  • @PWKad I've created that question too. As a matter of fact, I was posting one question at first. But it was getting complicated as it addresses two totally different questions. So I decided to post them as two separate questions. – mehrandvd Dec 08 '13 at 06:25

1 Answers1

2

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.

Louis
  • 146,715
  • 28
  • 274
  • 320