-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Support systemjs #2458
Comments
It looks like systemjs doesn't support the browserify middleware essential to building |
see same error message in browser with app built with browserify. mapboxgl.accessToken = "pk.eyJ1IjoiZW1ha2Fyb3YiLCJhIjoiMDFER0JicyJ9.0yaID4RS09gxfY4uyERhVQ"; |
meanwhile, this script works mapboxgl.accessToken = "pk.eyJ1IjoiZW1ha2Fyb3YiLCJhIjoiMDFER0JicyJ9.0yaID4RS09gxfY4uyERhVQ"; var inview = require('./plugins/jquery.inview.js'); |
@lucaswoj how about simply a configurable hook function that is responsible for invoking the worker code? For backwards compatibility (and ease of use) you could fall back to a webworkify-based default when not specified. I don't use systemjs, I'm bringing it up because This would make systemjs users happy, and let me pick a better alternative with webpack, and also give users full control over how exactly the worker code is executed. They could use it to spawn more than one worker thread, use a SharedWorker, use one worker for both mapbox and other work, run the code on the main thread, choose to keep worker threads around or shut them down, start worker threads in advance, etc.etc... most of these probably don't make much sense but the point is that you would enable people to make these choices for more advanced use cases. |
Not that my opinion matters, but I'll throw in (in case you didn't already know) that the folks at Angular are pushing all of their tuts and the Angular2-seed project with SystemJS. So, likely will be many more using SystemJS vs Webpack. |
FWIW I've worked around this using |
See #3235. |
mapbox-gl-js version: 0.17.0
Steps to Trigger Behavior
import mapboxgl from 'mapbox-gl'
System.import('app')
Expected Behavior
Library should work as normal with no errors.
Actual Behavior
Get error:
The text was updated successfully, but these errors were encountered: