Skip To ContentArcGIS for DevelopersSign In Dashboard

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 using arcgis-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

npm install esri-loader

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

npm install arcgis-js-api

Build locally with webpack

For API versions 4.17 and earlier, building locally with webpack requires the use of @arcgis/webpack-plugin.

Installation

npm install @arcgis/webpack-plugin

Usage

Here are examples of how to use esri-loader with frameworks:

Content