You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just asked this question on SO, and hoping a definitive answer might be had there, but if the one and only James Burke could answer it himself here or on SO that might be helpful:
I have been wondering this for a long time, using RequireJS, is there actually a difference between the global require function and the require function that is passed to a module like so:
I have read through the RequireJS docs a number of times, and I don't remember ever learning if there is a significant difference between the two functions. However, that being said, it seems reasonable to believe that they are different somehow, since if they were the same, there would be no need to pass the function to the module (?)
The text was updated successfully, but these errors were encountered:
They are different, the main thing is that the local require knows how to resolve './relative' dependency IDs relative to the module ID asking for the dependency..
The global one cannot do that. The global one has .config() on it, can be used to configure the loader. Those are the main differences.
Closing as a discussion ticket, feel free to continue discussion here.
I just asked this question on SO, and hoping a definitive answer might be had there, but if the one and only James Burke could answer it himself here or on SO that might be helpful:
http://stackoverflow.com/questions/35902490/requirejs-difference-between-global-require-and-module-require
the question is:
I have been wondering this for a long time, using RequireJS, is there actually a difference between the global require function and the require function that is passed to a module like so:
I have read through the RequireJS docs a number of times, and I don't remember ever learning if there is a significant difference between the two functions. However, that being said, it seems reasonable to believe that they are different somehow, since if they were the same, there would be no need to pass the function to the module (?)
The text was updated successfully, but these errors were encountered: