<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: @arcgis/core Angular Nx Build becomes incredibly big in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-core-angular-nx-build-becomes-incredibly/m-p/1037155#M72076</link>
    <description>&lt;P&gt;Lots of questions here. For the on-disk bundle size, what you see in a production build output is about as small as that footprint will get. The API will only use what's need at application runtime. If you have on-disk size limitations because you are running something like a SalesForce lightning component then there are some other approaches you might consider.&lt;/P&gt;&lt;P&gt;With regards to the assets, try testing with the latest "next" build: npm i&amp;nbsp;@Anonymous User/core@next (ignore the weird casing, it's caused by the text editor, the npm command is all lower case). When we release at 4.19 (early April) the assets are pulled from a CDN by default, so that will immediately result in an on-disk production build size decrease. You can override this if you want, in order to use the local assets.&lt;/P&gt;&lt;P&gt;4.19 also removes the critical dependency warnings.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can remove the "moment" warnings by adding the following to angular.json &amp;gt; build &amp;gt; options:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;            "allowedCommonJsDependencies": [
              "moment"
            ],    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Mar 2021 15:31:07 GMT</pubDate>
    <dc:creator>AndyGup</dc:creator>
    <dc:date>2021-03-16T15:31:07Z</dc:date>
    <item>
      <title>@arcgis/core Angular Nx Build becomes incredibly big</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-core-angular-nx-build-becomes-incredibly/m-p/1037092#M72075</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm currently building a prototype app with the new&amp;nbsp;@Anonymous User/core (4.18.1) package and Nx Angular monorepos (Angular 11).&lt;/P&gt;&lt;P&gt;If I build the application I get a number of compiler messages.&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#808080"&gt;Warning: E:\Projekte\nx-hwrm\nx-hwrm\libs\shared\feature-mapping-esri\node_modul&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;es\@arcgis\core\intl\moment.js depends on 'moment/locale/ko.js'. CommonJS or AMD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;dependencies can cause optimization bailouts.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;For more info see: &lt;A href="https://angular.io/guide/build#configuring-commonjs-dependenc" target="_blank"&gt;https://angular.io/guide/build#configuring-commonjs-dependenc&lt;/A&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;ies&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#808080"&gt;Warning: E:\Projekte\nx-hwrm\nx-hwrm\libs\shared\feature-mapping-esri\node_modul&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;es\@arcgis\core\intl\moment.js depends on 'moment/locale/ja.js'. CommonJS or AMD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;dependencies can cause optimization bailouts.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;For more info see: &lt;A href="https://angular.io/guide/build#configuring-commonjs-dependenc" target="_blank"&gt;https://angular.io/guide/build#configuring-commonjs-dependenc&lt;/A&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;ies&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#808080"&gt;Warning: ./libs/shared/feature-mapping-esri/node_modules/@arcgis/core/core/worke&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;rs/workers.js 5:863-872&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;Critical dependency: the request of a dependency is an expression&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#808080"&gt;Warning: ./libs/shared/feature-mapping-esri/node_modules/@arcgis/core/core/worke&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;rs/WorkerFallback.js 5:2264-2273&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#808080"&gt;Critical dependency: the request of a dependency is an expression&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;also the build generates more than 170 numbered bundles together 8MB. If I also include the whole esri assets folder this is another ~22MB.&lt;/P&gt;&lt;P&gt;I followed this guide:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/es-modules/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/es-modules/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Esri assets are copied to output dist folder with angular.json:&lt;/P&gt;&lt;P&gt;"assets": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "glob": "**/*",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "input": "libs/shared/feature-mapping-esri/node_modules/@arcgis/core/assets",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "output": "assets/"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Is there a way to have a more compact Angular build?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 12:54:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-core-angular-nx-build-becomes-incredibly/m-p/1037092#M72075</guid>
      <dc:creator>RichardReinicke</dc:creator>
      <dc:date>2021-03-16T12:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: @arcgis/core Angular Nx Build becomes incredibly big</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-core-angular-nx-build-becomes-incredibly/m-p/1037155#M72076</link>
      <description>&lt;P&gt;Lots of questions here. For the on-disk bundle size, what you see in a production build output is about as small as that footprint will get. The API will only use what's need at application runtime. If you have on-disk size limitations because you are running something like a SalesForce lightning component then there are some other approaches you might consider.&lt;/P&gt;&lt;P&gt;With regards to the assets, try testing with the latest "next" build: npm i&amp;nbsp;@Anonymous User/core@next (ignore the weird casing, it's caused by the text editor, the npm command is all lower case). When we release at 4.19 (early April) the assets are pulled from a CDN by default, so that will immediately result in an on-disk production build size decrease. You can override this if you want, in order to use the local assets.&lt;/P&gt;&lt;P&gt;4.19 also removes the critical dependency warnings.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can remove the "moment" warnings by adding the following to angular.json &amp;gt; build &amp;gt; options:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;            "allowedCommonJsDependencies": [
              "moment"
            ],    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 15:31:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-core-angular-nx-build-becomes-incredibly/m-p/1037155#M72076</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-03-16T15:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: @arcgis/core Angular Nx Build becomes incredibly big</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-core-angular-nx-build-becomes-incredibly/m-p/1037584#M72094</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;thank you very much for taking time to answer all my questions.&lt;/P&gt;&lt;P&gt;The bundle size is not a general problem but at the moment it slows down our Azure build. This is something we can enhance on our own with Azure and Nx tools.&lt;/P&gt;&lt;P&gt;For now I set the the version to&amp;nbsp;@next and I will keep my eyes open for the new release. The unwanted build messages disappeared.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 13:45:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-core-angular-nx-build-becomes-incredibly/m-p/1037584#M72094</guid>
      <dc:creator>RichardReinicke</dc:creator>
      <dc:date>2021-03-17T13:45:38Z</dc:date>
    </item>
  </channel>
</rss>

