Closed istarkov closed 2 years ago
This is autogenerated by emscripten transpiling the H3 C library to Javascript. There is no way to accomplish what you want.
Im pretty sure I can, it doesnt look like a big deal to convert generated function into module with exports and then bundle es module. Will you accept such PR?
We'd definitely accept PRs that improve the build!
If you're post-processing the build, this might not be relevant, but I thought it would be worth mentioning:
We're at least one major version behind on emscripten, this is something I've been meaning to improve. If you're going to look at the emscripten build, please:
As of now minimal bundle size I see with importing only single method like
import {latLngToCell} from 'h3-js'
is like140Kb+
The issue that generated esm in h3-js looks like
So the most generated code are inside
var libh3 = (function (libh3) {
But nor rollup not webpack can tree shake code inside functions.Would you mind to omit this init code from generator for esm to make it more tree shaking friendly?