mapbox / mapbox/mapbox-gl-directions
Package import broken without build
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 255
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Description
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](https://github.com/mapbox/mapbox-gl-directions/issues/157#issuecomment-566061339).
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](https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v4.1.0/mapbox-gl-directions.js) as well as the [css definitions](https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v4.1.0/mapbox-gl-directions.css) 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the package publishing and entry-point configuration, focusing on whether the dist directory is generated and included in releases. Compare the current package contents with version 3.1.3, then verify that a browser or Webpack import works and that the intended usage is documented if the entry point is not changed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100