Closed jscudder closed 3 years ago
@jscudder you can experiment with manually removing some of the subdirectories under /assets
. Once you remove a subdirectory you'll need to exercise all parts of your app to make sure you haven't removed something that is required.
For example:
/webscene
and then testing your app functionality./smartMapping
if you don't require smart mapping functionality. /themes
. You could keep this one @arcgis/core/assets/esri/themes/dark/main.css
and experiment with removing the other unused themes. e.g. SPComponentLoader.loadCss('@arcgis/core/assets/esri/themes/dark/main.css')
Just some ideas that could reduce the number of files quite a bit.
Here is what I did instead, and this workaround is working perfectly so far. I am no longer hosting the assets inside a SharePoint site. When my SharePoint map webpart is loading I make these two calls:
SPComponentLoader.loadCss("https://cdn.jsdelivr.net/npm/arcgis-js-api@4.18.0-next.20201213/assets/esri/themes/dark/main.css"); config.assetsPath = 'https://cdn.jsdelivr.net/npm/arcgis-js-api@4.18.0-next.20201213/assets';
Everything is working perfectly now with no more errors or UI issues.
When I include the @arcgis/core/assets contents in my SharePoint online SPFX webpart, SharePoint complains there are too many files (over 1000) included with my webpart. I know this is happening due to the number of files in @arcgis/core/assets. Is there any way I can bundle @arcgis/core/assets contents in my project to avoid this? Right now I am able to get a basic map showing (but without zoom, navigation, compass, popup and attribution controls) by including a line in the webpart: SPComponentLoader.loadCss('https://js.arcgis.com/4.18/esri/themes/dark/main.css');