1

I have installed the @arcgis/core 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/core

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>
sandrooco
  • 8,016
  • 9
  • 48
  • 86
Kalana Tebel
  • 135
  • 4
  • 17
  • It looks like you have already installed `@arcgis/core` which is the recommended package to use when integrating ArcGIS API with Angular. `arcgis-js-api` and `@arcgis/core` provide the same logic, with the only difference between them being that `arcgis-js-api` is the AMD version of the API and `@arcgis/core` - the ES Modules one. You only need `@arcgis/core`. Is there a reason you have also installed `arcgis-js-api`? – ardentia Jan 19 '22 at 10:03
  • Hi @ardentia. Could you please tell me how did you recognized that I've installed both? We are getting @arcgis/core after installing arcgis-js-api? isn't it? I'm confused a little bit there that's why :) – Kalana Tebel Jan 19 '22 at 10:33
  • My assumption was based on your imports - I saw `@arcgis/core`. I actually haven't used `arcgis-js-api` because I assumed it provides an AMD version of the modules. – ardentia Jan 19 '22 at 18:02
  • I have a similar issue. It seems to build countless locales (translations) for arcgis components. The problem: I didn't yet find a to only build what I really need. – sandrooco Jan 25 '22 at 15:49
  • Hi @ardentia. Sorry it was a mistake. I didn't use arcgis-js-api. Just @arcgis/core. But still having the same issue. – Kalana Tebel Jan 25 '22 at 15:52
  • Hi @sandrooco. I also feel the same. When I run ng serve, it's generating bunch of js files at the moment. – Kalana Tebel Jan 25 '22 at 15:56
  • It's not the best library so far but they are going into the right direction. I just added the arcgis-js-api tag so esri might find it and answer. – sandrooco Jan 25 '22 at 16:19
  • 2
    @KalanaTebel we asked some questions over at the duplicate posting on Esri Community: https://community.esri.com/t5/arcgis-api-for-javascript-questions/why-the-amount-of-build-files-increased-after/m-p/1135353#M76012. In general, unless you have a large application with a bunch of dynamic imports you shouldn't have that many modules. Keep in mind, the initial load of the application typically only uses a small portion of the on-disk modules, the remaining modules are lazy loaded dependencies. Please provide an example github repo so we can examine this issue further. – Andy Gup Jan 25 '22 at 22:46
  • @AndyGup. As you can see in the above code snippet, they way I'm importing is different from the way I used to import libraries in other components. (No curly brackets after import keyword) . I feel like something happening there. Will it be a issue? – Kalana Tebel Jan 31 '22 at 04:24

0 Answers0