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

Minification fails with uglifyjs and mapbox-gl-dev #7601

Closed
bdirito opened this issue Nov 20, 2018 · 2 comments
Closed

Minification fails with uglifyjs and mapbox-gl-dev #7601

bdirito opened this issue Nov 20, 2018 · 2 comments

Comments

@bdirito
Copy link

bdirito commented Nov 20, 2018

refs #4359 - fixed this for the nondev version of mapbox code

mapbox-gl: 0.51
uglify-js: 3.4.9
webpack: 4.26.0

import mapboxgl from 'mapbox-gl/dist/mapbox-gl-dev'

When you use uglifyJs with the dev version of the code minification fails with an

[Error] ReferenceError: Can't find variable: e (blob:http://localhost/f2a6b98f-a95d-452c-8f6b-9d058eeb6c45, line 1, x2)

error.

@mourner
Copy link
Member

mourner commented Nov 20, 2018

Right, we'll look into it. The root cause is probably the assert module, which gets treeshaken away in the production build, but causes problems in the development one.

@mourner
Copy link
Member

mourner commented Nov 28, 2018

While we still want to fix the dev build for webpack, the better option for this case is to use mapbox-gl/dist/mapbox-gl-unminified build instead of the dev one — it was created specifically for this purpose. It's like the production build (tree-shaken and without asserts) but not minified so that you can use your own minification setup.

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

No branches or pull requests

3 participants