Confirmed users
502
edits
(→Panels) |
(→Module) |
||
| Line 53: | Line 53: | ||
==== Shim ==== | ==== Shim ==== | ||
==== Module ==== | ==== Module ==== | ||
A module can depend on many others and it makes sense to merge them into one script in order to | A module can depend on many others and it makes sense to merge them into one script in order to reduce the loading time. When we declare the modules in require.js, all dependent modules are merged in the build process by r.js. Note that for fundamental modules frequently used by other modules, merging them may lead to duplicated code. We can exclude such modules when declaring. | ||
For example, the following module declaration will create a script containing all dependent modules starting from "modules/apn/apn_settings_manager". The paths in the "exclude" can be ordinary modules or modules just specified in require.js. | For example, the following module declaration will create a script containing all dependent modules starting from "modules/apn/apn_settings_manager". The paths in the "exclude" can be ordinary modules or modules just specified in require.js. | ||