Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import mapbox-gl such that it is transpilable #1365

Closed
wants to merge 2 commits into from

Conversation

arindam1993
Copy link

Following up from the transpilation issues described in mapbox/mapbox-gl-js#10173

With this PR I'm attempting to switch the import for mapbox-gl-js, and use the mapboxgl.workerClass hook so that the build system can recognize the separate bundles for main-thread and worker code.
This should allow arbitrary transpilation with Babel because it makes it aware of the multi-entrypoint nature of the library.

@Pessimistress
Copy link
Collaborator

Pessimistress commented Feb 23, 2021

react-map-gl does not ship its own pre-bundled version. All files are simply transpiled by babel. Correct me if I'm wrong, but this change means that every user will have to add a worker-loader config to their bundler to be able to use this library.

An alternative would be to distribute a pre-built mapbox-gl bundle with react-map-gl - I believe that is going to introduce some licensing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants