Files larger than 64KB are truncated

#7 · closed · 2 comments

View on GitHub ↗

bradisbell

On my system, files larger than 64KB fail to work, as they are truncated. The issue seems to stem from reading only the first chunk on the `data` event rather than buffering everything and then returning the full result. https://github.com/m90/esbuild-plugin-browserify-adapter/blob/main/index.js#L26

Comments

m90

This should be fixed in 0.1.5 which I just released. On a side note, I couldn't repro the 64kb limit on my machine, but had to artificially set a lower `highWaterMark` when reading. The bug was pretty obvious in any case, so the fix makes sense. Thanks for reporting.

bradisbell

Woot! Thanks for the awesomely fast fix! I was just about to work up a fork and pull request and you've solved it already. :-) Thanks! Confirmed that it fixed the issue on my machine.