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

require by alias #69

Closed
grydstedt opened this issue Oct 8, 2013 · 1 comment
Closed

require by alias #69

grydstedt opened this issue Oct 8, 2013 · 1 comment

Comments

@grydstedt
Copy link

I noticed that when setting up an alias such as:

paths: {
'jquery': 'vendor/jquery'
}

everything works will if I do only require('jquery') or require('vendor/jquery'). But if I happen use both paths in different parts of the code almond doesn't produce any output? Is this expected?

@jrburke
Copy link
Member

jrburke commented Oct 13, 2013

This is considered a misconfiguration: the same module ID should be used throughout the source. If that is not possible then the map config should be used instead of paths config.

Unfortunately this misconfiguration is hard to detect up front, so require.js does not generate an error about it. I would like to have xrayquire do it, but I have not gotten to it. The r.js optimizer in 2.1.9 will give an error for this case during a build though.

Closing here, as adding code to detect this would bloat the library, hoping tools like xrayquire can pick up the slack.

@jrburke jrburke closed this as completed Oct 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants