g3r4n / arcgispack

MIT License
6 stars 4 forks source link

ArcGISPack

Bundle the ArcGIS API for you

Examples

Usage

First, Add the arcgispack bundle to your application

You can use either the full build from the CDN or create a custom bundle.

<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/g3r4n/arcgispack@0.0.25/esri-bundle/bundle.js"></script>
<!-- uncomment the line below for local bundle -->
<!-- <script type="text/javascript" src="https://github.com/g3r4n/arcgispack/raw/master/esri-bundle/bundle.js"></script> -->

How to create your own bundle

  1. add the package Add arcgispack as a dev dependency

    npm i -D arcgispack

    or

    yarn add -D arcgispack
  2. create the arcgis.config.js file in the root folder

  3. update the configuration to match your needs

    • outputPath : folder where the API build will generate
    • dojoModules : Array of API dojo modules to build and to access through the lib entry
  4. generate a build (or update your package.json to create a task )

    npx arcgispack
  5. Build your amazing app as you wish without tradeoff

Second, Add your arcgispack bundle to your application

Use arcgis-wrapper to get modules from the ArcGIS JS API.

import { Map, SceneView, SceneLayer } from "arcgis-wrapper";

Why

The current arcgis/webpack-plugin has the following tradeoffs

Using this tool to bundle the esri js API allows you to build the application as you want without tradeoff.

TODO