// ── Leaflet, and only when the Map tab asks for it ──────────────────────── // // D116 put Leaflet on the map; D120 put it HERE, in a chunk of its own that the // Map tab imports with `import()`. Two reasons, and both are about `entry.js`: // // • `entry.js` is loaded on EVERY page of the site, because core injects every // started module's chunk into its shell. Leaflet in it would be ~40 KB gz on // the home page, the forum and the news, for a tab most visitors never open. // • Leaflet touches `document` and `window` the moment it is evaluated. The // chunk is evaluated in Node by `test/registration.test.js`, with a // `window` and nothing else — so Leaflet in the entry chunk fails that test // at import, before a single registration is checked. // // Vite emits this as `dist/map-.js` beside `entry.js`. Core serves the // directory `client.entry` sits in (MODULE_API.md §3.1), and `release.yml` // copies every `.js` in it — `test/build.test.js` holds both ends of that. // // The ESM build is imported by path: Leaflet 1.9.4's package.json names only its // UMD file, and the UMD one would go through CommonJS interop for nothing. // // The stylesheet comes in as a STRING and is injected once as a `