-
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
Remove support for building mapbox-gl with webpack and other non-browserify bundlers #3235
Conversation
👍 Given webpack's architectural choices, this seems like the only sane choice to me. Should we remove |
Ah, forgot to commit removal of the webpack config. Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
This fixed a lot of the problems I've been running into recently; thanks a bunch! 💟 As a sidenote for others running into this, if you're not down with the module: {
noParse: /node_modules\/mapbox-gl\/dist\/mapbox-gl.js/,
loaders: [{
...
}]
} |
…serify bundlers (#3235) * remove support for building mapbox-gl with webpack * clarify usage of mapbox-gl with other module bundlers * remove webpack config example
If you can't switch to dist (a module you use uses mapbox-gl, not you) you can still use the old way! Update webworkify-webpack once borisirota/webworkify-webpack#21 is published and your existing stuff should work fine. Alternatively, you can remove all of the old hacks and set up an alias which should work in most cases: resolve: {
alias: {
'mapbox-gl/js/mapbox-gl.js': 'mapbox-gl/dist/mapbox-gl.js'
}
} |
Closes #3230 #3229 #2458 and will prevent a ton of new issues like this in future.
This makes all the fragile webpack hacks unnecessary, gives us the possibility to confidently depend on Browserify (e.g. for things like #3034), and saves us a lot of time on future tricky bugs and support requests. There's also seem to be no benefit to building Mapbox GL with another bundler. We'll also be free to switch to any other bundle system in future when we see fit without legacy support concerns.
The only trouble this brings is that Webpack will throw a warning, which does not make sense in our particular case:
cc @jfirebaugh @lucaswoj @tmcw