benjamn / recast

JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator
MIT License
4.99k stars 349 forks source link

feat: make lib browser compatible #1237

Closed d3lm closed 1 year ago

d3lm commented 1 year ago

This PR makes recast browser compatible by using an assert polyfill which will only be used in the browser, because with Node.js assert is a built-in, as well as conditionally requires os only when executed with Node.js.

Closes #1235

d3lm commented 1 year ago

@eventualbuddha Any chance we could get this in and published? I'd really like to use recast in the browser, and for the time being I am using my fork.

eventualbuddha commented 1 year ago

Published in v0.22.0.

d3lm commented 1 year ago

Thanks so much!