node can be used to exclude any module from the build file. It’s only option is a map named
With this map, you have to assign every module that should be excluded using the special empty path:
1 2 3 4
# src/Acme/DemoBundle/Resources/config/requirejs.yml build: paths: 'bootstrap': 'empty:'
This node is used to configure where to find all available Require.JS modules. It offers the following three options:
The map option makes it possible to map module names to other module names depending on the module context in which they are required.
For example, the OroUIBundle ships with an extended version of the jQuery library. This means that all modules should receive the extended jQuery library from the OroUIBundle. However, since the bundle itself needs the original version of the library to be able to extend it, it must get the original version when requiring it:
1 2 3 4 5 6
config: map: '*': 'jquery': 'oroui/js/jquery-extend' 'oroui/js/jquery-extend': 'jquery': 'jquery'
* is a special key that matches all module contexts.
This option tells the bundle where each module can be found. The keys of the map are module names which are mapped to the actual path of the file that contains the module’s source code.
To make legacy libraries available for Require.JS, they can be wrapped as a Require.js module. Each key of the map is the name of a module to be created. For each module, a map must be specified that configures the module. It can consist of the following keys:
If the library depends on other libraries, these dependencies can be listed here. Note that the dependencies are treated as Require.js modules. This means that you may have to create more modules if your library depends on other traditionall built libraries.