I use requirejs to distribute the code into a single file.
In grunt.initConfig, I have:
grunt.initConfig({
requirejs: {
compile: {
options: {
paths: requirejs_path,
shim:require_shim,
baseUrl : "./mobile",
name: "mobilemain",
out: "./mobile/dist/main.js",
removeCombined: true,
findNestedDependencies: true,
optimize: "uglify2",
wrap: true,
uglify2: requirejs_uglify2
}
}
}
}
this this part of code to set up requirejs. and I use
grunt.registerTask("distribute", ["typescript", "requirejs"]);
to register it to a task distribute
, all works fine.
Now I want to call requirejs twice in the distribute
task, once for mobile and once for desktop. Basically I will need to change the baseUrl
, name
, and out
config in the above code.
How can I do that?