SamSamskies / react-map-gl-geocoder

React wrapper for mapbox-gl-geocoder for use with react-map-gl
MIT License
122 stars 29 forks source link

mapbox-gl neccessary dependency? #126

Closed jeroenkampinga closed 3 years ago

jeroenkampinga commented 3 years ago

I'm using react-map-gl-geocoder in combination with react-map-gl. When inspecting my bundle I see mapbox-gl.js is bundled twice. Once from react-map-gl and once as (peer)dependency from react-map-gl-geocoder. Is there a way to remove the duplicate code when combining this package with react-map-gl

bundle e.

SamSamskies commented 3 years ago

I'm not sure, but this project is pretty much in maintenance mode, so you could just copy pasta the code into your codebase instead of installing it as a dependency. It's only one file. I've always purposely kept all the code in one file to make it easy to copy pasta. Everything you need is in this file https://github.com/SamSamskies/react-map-gl-geocoder/blob/master/src/index.js.