Skip to content

Esm host bundling - #549

Merged
dannyleech merged 2 commits into
mainfrom
esm-host-bundling
Oct 1, 2026
Merged

dannyleech merged 2 commits into
mainfrom
esm-host-bundling

Conversation

@dannyleech

@dannyleech dannyleech commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes ESM host builds failing on map engines they don't use (e.g. Can't resolve 'ol/...' when using /plugins/draw with MapLibre).

  • maplibre-gl stays a dependency; ol, proj4 and @arcgis/core are optional peers. All engines are external in ESM builds, so hosts share one copy (datasets' OpenLayers adapter: 437 KB → 16.5 KB).
  • Datasets and draw adapter chunks no longer load another provider's adapter (OpenLayers maps were downloading the MapLibre draw adapter).
  • UMD builds no longer bundle Esri code (datasets UMD: 105 MB → 584 KB).
  • New "Bundler configuration (ESM)" docs for ignoring unused engines; datasets and draw link to it.

Tested using Claude with ESM (webpack, Vite, Rollup, esbuild) and UMD with MapLibre and OpenLayers, with and without datasets and draw.

@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@dannyleech
dannyleech marked this pull request as ready for review October 1, 2026 12:01
@dannyleech
dannyleech merged commit c2b592d into main Oct 1, 2026
3 checks passed
@dannyleech
dannyleech deleted the esm-host-bundling branch October 1, 2026 12:02
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.

2 participants