I have the following.
require([ 'a', 'b' ], function() {
if(x){
require([ 'c', 'd' ], function( ) {});
}
});
c will always be loaded with d. Is there anyway to make the optimizer optimize c and d so that they will load as one file?
EDIT:
Also im using r.js as the optimizer. And the modules for my build script look something like this.
modules: [
{
name: "main",
},
{
name: "c",
include: ["d"]
}
]
This will include d in c, but both c and d are still loaded at runtime.
I got the answer here
You can set up a path mapping in production to inform RequireJS that
dis located atc.Simply do: