To answer your question, if async
is set to a truthy value (true
, 1
, etc.), dojo/domReady
and dojo/ready
will be loaded when require
is called. If async
is not set, these modules are loaded immediately when dojo.js
is loaded. So there is no impact on how your code executes, it’s just about when those modules become available for use.
This is snippet from Dojo AMD description:
For backwards-compatibility, the loader starts up in synchronous mode by default, which loads the Dojo base API automatically:
<script src="path/to/dojo/dojo.js"></script> <script> // the dojo base API is available here </script>
To put the loader in the AMD mode, set the async configuration variable to truthy:
<script data-dojo-config="async: 1" src="path/to/dojo/dojo.js"></script> <script> // ATTENTION: nothing but the AMD API is available here </script>
Note that you can only set the async flag before dojo.js is loaded, and that in AMD mode, neither Dojo Base nor any other library is automatically loaded - it is entirely up to the application to decide which modules/libraries to load.