-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
work around webpack build warning with earcut #4097
Conversation
Thanks for the fix, @chris-cooper! @bagnell instead, is it possible to just use the unminified version of earcut? |
While we should always use the unminified version of libraries, if I recall correctly, there was no unminified version of earcut that did not include a bunch of debug code. @bagnell can you please confirm. |
Rather than modify the minified version, I'd rather see us modify an unminified version to not include it's debug code (or use pragmas) if possible. |
Thanks @mramato. A couple of things I forgot to mention:
|
@chris-cooper I'm seeing the warningin 1.23, too, but I'm not seeing any runtime errors. When do you see that? My test case it is admittedly pretty simple: I'm loading a GeoJSON with a polygon. I would expect that to trigger it, though. |
It was working OK locally, but intermittently gives the following error when running from a remote server...
|
I looked into this some more and I think the easiest thing to do is just remove the source map directive from the submitted file. The "build" we are using is nothing more than the commonjs source file that @chris-cooper mentioned but with a UMD wrapper, so removing the source map should fix the issue without introducing any problems (or making it hard to maintain). I'll open a PR for people to try out. |
@chris-cooper can you give #4169 a try and confirm it fixes the issue? Thanks. |
There was additional discussion of this in #4169, ultimately it is a webpack issue but there's no reason we can't work around it since we know Cesium sues AMD and there's significant maintenance overhead here. |
Thanks @chris-cooper |
Pulling in Cesium via webpack produces the following warning...
This PR strips the boilerplate from earcut so it can be loaded directly like other Cesium modules.