Build with AMD modules
Introduction
The ArcGIS API for JavaScript's AMD modules are recommended for doing local builds with Dojo 1 and RequireJS.
- The modules can be lazy loaded from CDN using the
esri-loader
helper library. - The modules can be installed locally via
npm
usingarcgis-js-api
. - For API versions 4.17 and earlier, build modules locally with webpack using
@arcgis/webpack-plugin
.
Lazy load CDN modules
esri-loader
is a tiny library that lazy loads modules from the CDN hosted build of the API. It works in applications that are built with any loader/bundler, including webpack, rollup.js, or Parcel.
Installation
Usage
Here are examples of how to use esri-loader with frameworks:
For more details on how to use the loadModules()
method to lazy-load any version of the ArcGIS API for JavaScript in any framework see the esri-loader usage documentation. The plugin uses a lightweight AMD loader during the webpack build process to resolve module paths. The AMD loader is not used in the output application, it creates bundles with ArcGIS API for JavaScript.
Build locally with arcgis-js-api
You can npm install the AMD modules using arcgis-js-api
. Samples and additional instructions are available in the jsapi-resources github repository. When working API versions 4.18 and later, there's no need to use the webpack plugin.
Installation
Build locally with webpack
For API versions 4.17 and earlier, building locally with webpack requires the use of @arcgis/webpack-plugin.
Installation
Usage
Here are examples of how to use esri-loader with frameworks: