mapbox / mapbox-gl-directions

Directions plugin for mapbox-gl-js using Mapbox Directions API.
https://mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/
ISC License
235 stars 124 forks source link

Package import broken without build #269

Open cafca opened 3 years ago

cafca commented 3 years ago

The distribution currently does not include built files. In version 3.1.3 this was included at dist/. Even then it was not documented but people found a workaround to use this in their code.

Please return to publishing the dist directory and ideally change the main entry point to that as well (or visibly document how to import this lib for use in a browser environment).

C.f. https://mykeels.medium.com/node-how-to-handle-your-dist-files-9667f47316ab

Thanks!

Edit: If anybody finds this issue looking for a way to use mapbox-gl-directions in a Webpack setup, I was able to work around this issue by including the full bundle as well as the css definitions in my source code. In addition, I had to use import * as MapboxDirections for the import and manually call directions.mapState() after adding the control to my (fully loaded) map instance.