-
Notifications
You must be signed in to change notification settings - Fork 592
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
Request: please provide ES5 compiled code #725
Comments
try import @mapbox/mapbox-gl-draw/dist/mapbox-gl-draw |
@ jingsam that worked perfectly, thank you! Happy to submit a PR to add this into the README as a workaround but would be great if this worked as expected with |
This is also causing a problem for me which is less simple to resolve, as we are using I realise this may be an issue to filed opened against the |
Using the complied code via I'm all ears for better solutions. |
Better solution is add to "es2015": "./esm2015/common.js",
"main": "./bundles/common.umd.js",
"module": "./esm5/common.js", This should work at least for Webpack and based on it tools (AngularCLI, React Create App and etc) |
@thekip could you run this out in a PR? |
It might be worth looking into rollup for this kind of support. |
I am having a related but different problem. I am creating a new mode, but at the same time I want to reuse Do you have a suggestion how can I make it work in my case? |
@thiagoxvo - In the spirit of keeping this ticket about shipping Draw in different flavors of JS, can you please open a different issue suggesting making common_selectors a public API. I suspect the real solution is for us to extend what default functions are on the mode_interface rather than having you require that file. @mgvarley or @thekip (really anyone) do you have sometime to make a PR for the solution @thekip outlined? |
Sure @mcwhittemore I will open another ticket. |
FWIW I have been using the following script:
which generates ES5 versions of each of the source files. This solves @thiagoxvo 's issue:
works without requiring any modification to Mapbox Draw's API. |
Fixed. |
This isn't fixed as far as I can see. You still have to import |
mapbox-gl-js version: 0.42.2
mapbox-gl-draw version: 1.0.4
Steps to Trigger Behavior
Following the link suggests the issue is due to code not published as ES5 on npm, presumably mapbox-gl code is published in this way, would be great if mapbox-gl-draw would follow the same approach:
Expected Behavior
A clean build when including @mapbox/mapbox-gl-draw in a project that uses create-react-app and/or UglifyJS
Actual Behavior
Including @mapbox/mapbox-gl-draw breaks the build. Just including mapbox-gl works fine.
The text was updated successfully, but these errors were encountered: