GoogleChromeLabs / jsbi

JSBI is a pure-JavaScript implementation of the official ECMAScript BigInt proposal.
https://v8.dev/features/bigint#polyfilling-transpiling
Apache License 2.0
919 stars 68 forks source link

UMD version is used when bundled with Webpack #42

Open jgonera opened 4 years ago

jgonera commented 4 years ago

I'm building an app that targets only new browsers but when I import JSBI from 'jsbi' Webpack uses the UMD bundle because the browser field from package.json takes precedence over module field. My understanding was that the browser field was used only for packages that implement browser-specific code (using browser APIs). Is there a reason why an UMD build is needed these days given how widely used code bundlers are?

This is not a big deal now since the UMD version is only slightly bigger but will become more relevant if https://github.com/GoogleChromeLabs/jsbi/issues/22 gets resolved (UMD build won't work with tree-shaking).

jgonera commented 4 years ago

Tangential to this (but also not relevant until this is resolved), it would be great if non-UMD versions were not minified. I'm trying to debug something right now and all I see in the profiler are single-letter function names. I know I can just copy the JSBI source over to my project but it's slightly less convenient :)