Closed AtofStryker closed 5 years ago
It is transpiled. E.g. see https://unpkg.com/kdbush@3.0.0/kdbush.js, which is the main export. You seem to have some issue with your bundling setup.
@AtofStryker is correct, the main
export is transpiled but by default webpack will import the files defined in the module
of package.json
(which are shipped es6+, class
, const
etc) so if this is a transitive dependency in your project (i.e. mapbox-gl & supercluster) you have to specifically tell webpack (or your bundler) to transpile this lib.
That being said. I prefer packaged code to have the latest features it is just there is no obvious way to know from an npm install
or a webpack build
Hey @mourner, no doubt that the code is transpiled on the main property. However as @brendanmoore states webpack and parcel will pick up the module property meaning we get the ES6 version of the code. On the current version of Parcel (v1) we have no way of transforming third party modules which means we still pull in ES6 code and it can't run in IE11.
@jonathanchrisp I still believe that a bundler bug (or a design mistake) shouldn't force open source maintainers to change a perfectly valid setup. They should either stop using the module
field in legacy contexts, or have a way to transpile those.
Looks like all the code exported is in ES6 syntax. Currently I am running babel against the package to transpile it. Is there a way we can add this step to the build process so that the code consumed is in ES% format and can run cross browser?