The Mapbox GL JS library is currently bundled rather than imported. This is done for two reasons:
The Svelte REPL imports the latest version of dependencies rather than the versions in the package.json, which means it tries to import v2 (pay-per-use) instead of v1 (open-source).
Mapbox GL JS is not coded as an ES6 module, which means that it doesn't seem to play nicely with SvelteKit. As the library is currently using an ES6-compatible version of the JS file generated by Skypack, although SvelteKit still seems to be experiencing issues.
Ideally, we should find a better way to import the dependency, or to explore the use of MapLibre GL JS as a plug-in replacement.
The Mapbox GL JS library is currently bundled rather than imported. This is done for two reasons:
Ideally, we should find a better way to import the dependency, or to explore the use of MapLibre GL JS as a plug-in replacement.