oculus42 / short-uuid

Translate standard UUIDs into shorter formats and back.
MIT License
450 stars 13 forks source link

Add support for browsers via browserify #1

Closed voronianski closed 7 years ago

voronianski commented 7 years ago

On hold for now, until https://github.com/HarasimowiczKamil/any-base/pull/1 will be merged!

oculus42 commented 7 years ago

I pulled down the changes and ran browserify locally. It produced a ~600K file (before uglify) from the original ~14K of uncompressed sources. I would like to make short-uuid available for client-side use, but that expansion is flat-out crazy.

This seems to be because node-uuid checks for node or browser and even though it doesn't need all the libraries, browserify is helpfully loading them for us. If I manually remove the Node references from node-uuid, Browserify comes down to ~13.8K. I'm going to dig in and see if we can make this smaller.

As a side-note I tried webpack. It produced a ~130K file. Better, but still crazy.

voronianski commented 7 years ago

@oculus42 this can be closed now?

oculus42 commented 7 years ago

As of short-uuid@2.1.1 the dist files are in the npm package, as requested. Closing.

oculus42 commented 7 years ago

Thank you for suggesting it.