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
//This function will be called when all the dependencies
542
+
//listed above are loaded. Note that this function could
543
+
//be called before the page is loaded.
544
+
//This callback is optional.
545
+
}
547
546
);
548
547
</script>
549
548
</code></pre>
@@ -585,7 +584,7 @@ <h2>
585
584
586
585
<pid="config-locale"><strong>locale</strong>: The locale to use for loading i18n bundles. By default navigator.language or navigator.userLanguage will be used. The proper syntax for specifying a locale is using lowercase and separating values by dashes, for instance: "fr-fr-paris" or "en-us".</p>
587
586
588
-
<pid="config-context"><strong>context</strong>: A name to give to a loading context. This allows require.js to load multiple versions of modules in a page, as long as each top-level require call specifies a unique context string. See <strong>Advanced Features</strong>below.</p>
587
+
<pid="config-context"><strong>context</strong>: A name to give to a loading context. This allows require.js to load multiple versions of modules in a page, as long as each top-level require call specifies a unique context string. To use it correctly, see the <ahref="#multiversion">Multiversion Support</strong>section.</p>
589
588
590
589
<pid="config-deps"><strong>deps</strong>: An array of dependencies to load. Useful when require is defined as a config object before require.js is loaded, and you want to specify dependencies to load as soon as require() is defined.</p>
591
590
@@ -738,7 +737,7 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
738
737
739
738
<pre><code>//main.js contents
740
739
//Pass a config object to require
741
-
require({
740
+
require.config({
742
741
packagePaths: {
743
742
".packages": ["alpha", "omega"]
744
743
},
@@ -791,7 +790,7 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
791
790
792
791
<p>Then the RequireJS configuration would look like so:</p>
793
792
794
-
<pre><code>require({
793
+
<pre><code>require.config({
795
794
packagePaths: {
796
795
".packages": [
797
796
{
@@ -813,7 +812,7 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
813
812
814
813
<p><strong>packagePaths</strong> is just a convenience for listing several packages that are not direct siblings of require.js, but still have a common directory parent. The above configuration could be written like so with just the <strong>packages</strong> config option, by using the <strong>location</strong> property for each third-party package:</p>
815
814
816
-
<pre><code>require({
815
+
<pre><code>require.config({
817
816
"packages": [
818
817
{
819
818
name: "alpha",
@@ -839,49 +838,49 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
<p>As mentioned in <ahref="#config">Configuration Options</a>, multiple versions of a module can be loaded in a page by using different "context" configuration options. Here is an example that loads two different versions of the alpha and beta modules (this example is taken from one of the test files):</p>
841
+
<p>As mentioned in <ahref="#config">Configuration Options</a>, multiple versions of a module can be loaded in a page by using different "context" configuration options. require.config() returns a require function that will use the context configuration. Here is an example that loads two different versions of the alpha and beta modules (this example is taken from one of the test files):</p>
0 commit comments