radarlabs / radar-sdk-js

Web JavaScript SDK for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
42 stars 11 forks source link

[FEATURE] Add tree-shaking support #165

Open sorioinc opened 4 months ago

sorioinc commented 4 months ago

Hello all 👋🏼

Our final app bundle becomes huge after adding maplibre-gl. Our use case only includes the use of the SearchApi autocomplete feature, nothing around the UI and mapping. However, since maplibre-gl is a dependency, not adding it results in error and blocks javascript execution; even if we are not making use of the mapping.

We are using Webpack, so I created an alias on production build that will replace maplibre-gl with a mock module. But it feels hacky.

Can you make radar-sdk-js tree-shakeable, please?