Frage

I am running r.js in a build step of my project to concatenate and minify javascript. I would like to specify the output for the built scripts from the command line instead of in the bulid script.

For the curious; my build script looks something like the following

({
   mainConfigFile: 'main.js',
   modules: [

        //Main
        {
           name: 'main',
           exclude: ['loadKoTemplate']
        },
        {
           name: 'AnotherScreen',
           exclude: ["knockout"]
        }            
   ],
   dir: 'Built' //I would like to exclude this line
})

And during an MSBuild I call out to it like so

<Exec Command="$(ProjectDir)Dependencies\node\node $(ProjectDir)Dependencies\node\node_modules\requirejs\bin\r.js -o $(ProjectDir)scripts\app.build.js" />

I would like to put the built scripts in an intermediate build folder (an obj folder) before I copy them to their final location. This allows me to build differently depending on the project configuration.

Is there a way to do this?

War es hilfreich?

Lösung

Try:

<Exec Command="$(ProjectDir)Dependencies\node\node $(ProjectDir)Dependencies\node\node_modules\requirejs\bin\r.js -o $(ProjectDir)scripts\app.build.js dir=Built" />

I do the job like that on Linux with:

node lib/requirejs/r.js -o build.js dir=./vendor
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top