Shim config documentation misguide user with paths config. #730

Open
dferrin opened this Issue Apr 30, 2013 · 1 comment

Projects

None yet

2 participants

@dferrin

Here is an example. It requires RequireJS 2.1.0+, and assumes backbone.js, underscore.js and jquery.js have been installed in the baseUrl directory. If not, then you may need to set a paths config for them:

This is incorrect.

With RequireJS 2.15, I tried setting my jquery plugins paths aliases with the 'paths' config but it didn't work. I had to to write down the full plugin path relative to the baseUrl directory to make the shim config work. I can update the doc with a pull request if needed.

Thanks.

@jrburke
requirejs member

Can you give more info on how it failed, perhaps with a more concrete example? It should work out if the paths config values are either absolute paths, or if relative, relative to the baseUrl setting. So,

requirejs.config({
  baseUrl: 'scripts',
  paths: {
    jquery: 'jquery-2.0.0/jquery-2.0.0'
  }
});

With that config, 'jquery' will be loaded from scripts/jquery-2.0.0/jquery-2.0.0.js. If you could modify that example config to show how it fails, that might help identify the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment