Add buffer import to simplify browser builds#405
Conversation
|
@JAForbes I haven't tested this, but I see references to both |
| avsc = require('../../../../lib'); | ||
|
|
||
| avsc = require('../../../../lib'), | ||
| {Buffer} = require('buffer'); |
There was a problem hiding this comment.
This syntax isn't compatible with older Node versions, could you swap to one that is? For example:
// ...
buffer = require('buffer');
var Buffer = buffer.Buffer;Also, feel free to skip the files in etc/ as they are not included in the distributed package.
There was a problem hiding this comment.
Yep no worries. Yeah I think that syntax is Node 16+.
| */ | ||
|
|
||
| var buffer = require('buffer'); | ||
| var Buffer = buffer.Buffer; |
There was a problem hiding this comment.
@mtth I left this /etc file in, I wasn't sure if it was a polyfill for the browser and may need the explicit import.
There was a problem hiding this comment.
Good call, it is. I'd forgotten about that one.
| */ | ||
|
|
||
| var buffer = require('buffer'); | ||
| var Buffer = buffer.Buffer; |
There was a problem hiding this comment.
Good call, it is. I'd forgotten about that one.
|
Published as |
Fixes #403