Question

I am trying to specify compilation for two files in the build.js file for RequireJS optimizer. But only the last file gets optimized. Here's the build.js file:

({
    baseUrl: "..",
    name: "client/TestA",
    out: "full.js",
    findNestedDependencies: true
},{
    baseUrl: "..",
    name: "client/TestB",
    out: "fullB.js",
    findNestedDependencies: true
})

In this case only the last entry client/TestB is getting built. I need the require Optimizer to build both.

Was it helpful?

Solution

Where did you found this format of build.js file? Maybe you need something like modules field?

It should be something like this:

({

    baseUrl: "..",
    dir : './out' // required when using modules, instead 'out' field
    modules: [
        {
            name: "client/TestA"
        },
        {
            name: "client/TestB"
        }
    ],
    findNestedDependencies: true
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top