Actually it is very simple:
requirejs: {
compile: {
options: {
...
optimize: "none"
}
},
compileForProduction: {
options: {
...
optimize: "uglify2"
}
}
}
(options are same as yours, with any diffs between the two that are required, e.g. optimize
)
Run it with:
grunt requirejs:compileForProduction
or in Gruntfile.js
:
grunt.registerTask("prod", ["requirejs:compileForProduction"]);
and:
grunt prod