-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Make the distribution build the main NPM entry point #3551
Comments
I think this is a good idea. Do you have a sense of what precedent exists for similar libraries?
We could build system that ensures |
We should avoid committing the build to the repo at all costs. I think it's much easier to just publish a prerelease version in case we have to require a particular version from a downstream module. |
We should do this. Bug reports from webpack users who are doing |
If we're going to make 'dist/mapbox-gl.js' the main script for the NPM package, then I'd like to advocate that we also support The occasions when it's necessary to target a specific commit of a library may be infrequent, but I think they can be sort of severe or urgent: it's the kind of thing where you're fighting some subtle bug for hours trying to ship something and finally the only workaround involves temporarily forking/patching the lib you're depending on and installing your fork. It's invaluable in those cases to be able to do |
Currently our readme suggests
require('mapbox-gl')
for Browserify-bundled projects andrequire('mapbox-gl/dist/mapbox-gl.js')
for all the rest.But is there a real need to support building Mapbox GL JS from within a Browserify-bundled project? Would it be better overall to just change the main entry point in the
package.json
todist/mapbox-gl-dev.js
and make the workflow the same (require('mapbox-gl')
) for all module systems?This would also enable us to safely use a Yarn lockfile in the repo (#3364 ) for producing the same build and not worry about any downstream modules, and also move all
dependencies
intodevDependencies
for a lighter downstream install.The only cons I can think of:
mapbox-gl
dependencies likegeojson-vt
orearcut
. Very rare and not a big deal.mapbox-gl
in a Browserify-bundled downstream module. Not a big deal as well.Thoughts @jfirebaugh @lucaswoj @tmcw?
The text was updated successfully, but these errors were encountered: