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
Copy file name to clipboardExpand all lines: docs/api.html
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -543,6 +543,21 @@ <h2>
543
543
544
544
<p>When run in a browser, <ahref="#pathsfallbacks">paths fallbacks</a> can be specified, to allow trying a load from a CDN location, but falling back to a local location if the CDN location fails to load.</p>
545
545
546
+
<pid="config-bundles"><strong><ahref="#config-bundles">bundles</a></strong>: Introduced in RequireJS 2.1.10: allows pointing multiple module IDs to a module ID that contains a bundle of modules. Example:</p>
<p>That config states: modules 'main', 'util', 'text' and 'text!template.html' will be found by loading module ID 'primary'. Module 'text!secondary.html' can be found by loading module ID 'secondary'.
557
+
</p>
558
+
559
+
<p>This is useful if doing a build and that build target was not an existing module ID, or if you have loader plugin resources in built JS files that should not be loaded by the loader plugin. <strong>Note that the keys and values are module IDs</strong>, not path segments. They are absolute module IDs, not a module ID prefix like <ahref="#config-paths">paths config</a> or <ahref="#config-map">map config</a>. Also, bundle config is different from map config in that map config is a one-to-one module ID relationship, where bundle config is for pointing multiple module IDs to a bundle's module ID.</p>
560
+
546
561
<pid="config-shim"><strong><ahref="#config-shim">shim</a></strong>: Configure the dependencies, exports, and custom initialization for older, traditional "browser globals" scripts that do not use define() to declare the dependencies and set a module value.</p>
547
562
548
563
<p>Here is an example. It requires RequireJS 2.1.0+, and assumes backbone.js, underscore.js and jquery.js have been installed in the baseUrl directory. If not, then you may need to set a paths config for them:</p>
0 commit comments