Use other libraries
There are three ways to load a third-party library in ArcGIS Web AppBuilder. Depending on the library and the purpose of your app, choose one of the following to load it:
- Put the library in the resources array defined in the init.js file. The third-party JavaScript
library or CSS library can be loaded in this way. All resources in the resources
array are loaded first by the loadResource method when the app loads. Keep the following in mind:
- The loadResource method does not ensure the loading order. As a result, the third-party library may be loaded before or after ArcGIS API for JavaScript.
- Use this approach when you want to load a non-AMD module shared with more than one widget. However, it does not apply to AMD modules.
- Put the library in the libs folder and add it to the libs/main dependency array. Use this approach to load a shared AMD module.
- Put the library in the widget or theme folder and add it to your widget or theme dependency array. Use this approach to load an AMD module that only applies to one widget or theme.