diff --git a/client-next/src/mapbox-gl-empty-replacement.js b/client-next/src/mapbox-gl-empty-replacement.js new file mode 100644 index 00000000000..786ff326fec --- /dev/null +++ b/client-next/src/mapbox-gl-empty-replacement.js @@ -0,0 +1,3 @@ +// The only purpose of this module is to silence an error thrown by Vite in development mode +// due to a (intentionally) missing *optional* peer dependency (mapbox-gl). +export default {}; diff --git a/client-next/vite.config.ts b/client-next/vite.config.ts index 8d3ba8000c7..18cf7270447 100644 --- a/client-next/vite.config.ts +++ b/client-next/vite.config.ts @@ -9,4 +9,9 @@ export default defineConfig({ outDir: 'output', emptyOutDir: true, }, + resolve: { + alias: { + 'mapbox-gl': 'src/mapbox-gl-empty-replacement.js', + }, + }, });