import { setMapLibreWorkerUrl } from "./MapLibreWorker"; // Side-effect module: points maplibre-gl at the worker script of the caller's own // maplibre-gl install. Bundlers that support `new URL(..., import.meta.url)` assets // (Vite build) emit the file and rewrite this URL. A caller can override // it with setMapLibreWorkerUrl, which runs after this module has been evaluated. // // It is kept apart from MapLibreWorker.ts because Jest's Babel pipeline cannot parse // `import.meta`; Jest maps this module to an empty stub. try { setMapLibreWorkerUrl( new URL("maplibre-gl/dist/maplibre-gl-worker.mjs", import.meta.url).href ); } catch { // This runs when the library is imported, so it must never throw. A caller that mocks // maplibre-gl without setWorkerUrl, or a bundler that rejects the URL, would otherwise // fail on import. The caller can still call setMapLibreWorkerUrl itself. }