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.

有帮助吗?

解决方案

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
});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top