2 ms·
It's been a really long time since I last used this tool, but I think it always executed asynchronously within a callback function. So doing stuff like `var fo
by TheAceOfHearts 3y ago
It's been a really long time since I last used this tool, but I think it always executed asynchronously within a callback function.
So doing stuff like `var foo` wouldn't affect the global scope, since your code was always supposed to be placed inside a function call which receives all dependencies as a parameter.
https://requirejs.org/docs/api.html https://requirejs.org/docs/api.html
- WorldMaker 3y agoAMD modules (the name of the types of modules that RequireJS and other loaders, there were multiple competitors) were very much a thing. (Still are in the ArcGIS world that bet heavily on ancient framework Dojo and will take years still to migrate to ESM. Though luckily for them they get to skip CommonJS altogether.) Bundlers made people forget the pains but also the useful lessons of AMD modules.