Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure modules: and name+out are not allowed in the config #115

Closed
jrburke opened this issue Feb 23, 2012 · 0 comments
Closed

Make sure modules: and name+out are not allowed in the config #115

jrburke opened this issue Feb 23, 2012 · 0 comments
Milestone

Comments

@jrburke
Copy link
Member

jrburke commented Feb 23, 2012

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

//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'
  },
];
jwhitley added a commit to jwhitley/requirejs-rails that referenced this issue Feb 23, 2012
This is a workaround for an incompatibility in the generated config
introduced in r.js 1.0.7.  See requirejs/r.js#115 for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant