StableLib / stablelib

A stable library of useful TypeScript/JavaScript code
https://www.stablelib.com
Other
173 stars 35 forks source link

fix(random): hint bundler browser targets, webpack5 #30

Closed zachferland closed 3 years ago

zachferland commented 3 years ago

webpack5 no longer by default polyfills node libs like crypto, so by default build/bundle fails when consuming lib https://webpack.js.org/blog/2020-10-10-webpack-5-release/#automatic-nodejs-polyfills-removed

noticed already split by node/browser for runtime, this just hints to bundlers (webpack5) for browser targets that its safe to not include crypto and wont complain at build

probably helpful having similar changes in other packages here as well, but currently only needed random for now

dchest commented 3 years ago

Sorry for the wait, it's merged now. Thank you for your contribution! I'll release the updated version soon.

jmrossy commented 3 years ago

Thanks @zachferland, I needed this exact fix :)

@dchest do you know when you'll be releasing an updated version with this?

dchest commented 3 years ago

@jmrossy just released