Skip to content

fix: move esriConfig in disconnected enviro sample#593

Merged
omarkawach merged 5 commits intomainfrom
omar-disconnected-esriconfig
Oct 23, 2025
Merged

fix: move esriConfig in disconnected enviro sample#593
omarkawach merged 5 commits intomainfrom
omar-disconnected-esriconfig

Conversation

@omarkawach
Copy link
Collaborator

@omarkawach omarkawach commented Oct 23, 2025

Updated due to the fact the esriConfig should be set as early as possible, otherwise requests to js.arcgis.com will be made.

@omarkawach omarkawach self-assigned this Oct 23, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR relocates the esriConfig configuration from JavaScript (main.js) to the HTML file (index.html) to ensure it's set before any ArcGIS modules load. This follows best practices for disconnected environment setups where early configuration is critical.

Key Changes

  • Removed esriConfig import and configuration from main.js
  • Added inline <script> block in index.html to set globalThis.esriConfig before module loading
  • Updated code comments to reflect the new configuration location

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
component-samples/disconnected-environment/main.js Removed esriConfig import and configuration, updated comments to exclude reference to @arcgis/core assets
component-samples/disconnected-environment/index.html Added inline script block to configure esriConfig globally before any modules load

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

globalThis.esriConfig = {
assetsPath: "./assets",
// Optional: point to your Enterprise /portal/apps/fonts directory
// fontsUrl: "https://<your-enterprise-portal>.com/portal/apps/fonts/",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add something like:

// portalUrl: "https://<your-enterprise-portal>.com/portal",

Copy link
Member

@andygup andygup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@omarkawach omarkawach merged commit 32d8835 into main Oct 23, 2025
@omarkawach omarkawach deleted the omar-disconnected-esriconfig branch October 23, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants