I am using requireJS 2.x. I found out that some tutorials (and the official docs) sometimes use
requirejs.config({ [...] });
requirejs(["module"]) ...
and sometimes
require.config({ [...] });
require(["module"]) ...
Is there any difference between those two functions (require and requirejs)? I could not find any word about that in the docs. 🙁
They are exactly the same.
The reason is some environments might already have a
require, in which case RequireJS doesn’t overwrite it and allows usage of the library throughrequirejsSee this commit – https://github.com/jrburke/requirejs/commit/be45948433b053921dc6a6a57bf06d04e13b3b39