Why the amount of build files increased after installing ArcGIS JS in the Angular application

602
1
01-20-2022 01:59 AM
ChFaiza
New Contributor

I have installed the arcgis-js-api 4.x by using npm into my Angular application. After that when i'm going to deploy the changes in to my QA environment, it has more than 500 build files. Earlier it was only 19 build files.

Can anyone help me to reduce the files and tell me why this happened.

npm package - https://www.npmjs.com/package/arcgis-js-api

ts.file

import { Component, OnInit, ElementRef,Input,OnDestroy,ViewChild,} from '@angular/core';
import Map from "@arcgis/core/Map";
import config from '@arcgis/core/config';
import MapView from '@arcgis/core/views/MapView';
import FeatureLayer from '@arcgis/core/layers/FeatureLayer

    const map = new Map({
      basemap: 'topo-vector',
      layers: esriLayers
  });
  const view = new MapView({
      container,
      map: map,
    });

  this.view = view;

.html file

<!-- Map Div -->
<div #mapViewNode></div>

 

1 Reply
AndyGup
Esri Regular Contributor

I'm a little confused - the comments above mention using https://www.npmjs.com/package/arcgis-js-api but the sample is using https://www.npmjs.com/package/@arcgis/core? Also, what were you using previously that only had 19 files on-disk, that sounds like you might have been using esri-loader which is CDN-based. Can you share a github repo?

Check out our Angular 13 sample: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli. I'm seeing 208 files and 8.5MB on-disk. Note, not all of these files are being used on initial application load. 

0 Kudos