jrburke/r.js — Issue #115: Make sure modules: and name+out are not allowed in the config
Author: jrburke
Created: 2012-02-23 21:05:42+00:00
State: open

Just need to warn the user on incompatible config. Example:

```javascript
//Load the requirejs optimizer
var requirejs = require('/Users/whitley/.rvm/gems/ruby-1.9.3-p125@twr/gems/requirejs-rails-0.5.6/bin/r.js'),
//Set up basic config, include config that is
//common to all the optimize() calls.
basConfig = {
"baseUrl": "/Users/whitley/src/twr/dashbuzz/tmp/assets",
"modules": [
{
"name": "application"
},
{
"name": "charts"
}
],
"paths": {
"d3": "d3/d3",
"d3.time": "d3/d3.time"
}
};

// Function used to mix in baseConfig to a new config target
function mix(target) {
for (var prop in basConfig) {
if (basConfig.hasOwnProperty(prop)) {
target[prop] = basConfig[prop];
}
}
return target;
}

var module_specs = [
{
name: "application",

out: '/Users/whitley/src/twr/dashbuzz/public/assets/application.js'
},
{
name: "charts",

out: '/Users/whitley/src/twr/dashbuzz/public/assets/charts.js'
},
];

```