Skip to content

Fix directly using Buffer instead of util.Buffer#571

Merged
dcodeIO merged 1 commit intoprotobufjs:masterfrom
fnlctrl:patch-2
Dec 18, 2016
Merged

Fix directly using Buffer instead of util.Buffer#571
dcodeIO merged 1 commit intoprotobufjs:masterfrom
fnlctrl:patch-2

Conversation

@fnlctrl
Copy link
Copy Markdown
Contributor

@fnlctrl fnlctrl commented Dec 18, 2016

This seems to have caused webpack to load a Buffer shim when building for web.

This seems to have caused webpack to load a Buffer shim.
@dcodeIO dcodeIO merged commit ccc5de1 into protobufjs:master Dec 18, 2016
@dcodeIO
Copy link
Copy Markdown
Member

dcodeIO commented Dec 18, 2016

Thanks!

@fnlctrl fnlctrl deleted the patch-2 branch December 18, 2016 14:39
@dcodeIO
Copy link
Copy Markdown
Member

dcodeIO commented Dec 18, 2016

Btw, doesn't this cause the same?

@fnlctrl
Copy link
Copy Markdown
Contributor Author

fnlctrl commented Dec 18, 2016

Yes, this PR didn't solve the problem, and I forgot to leave a comment here.
Since it's dynamic require, I can't seem to think of a way to properly solve it.. So as a workaround, I now use webpack.IgnorePlugin to force disable loading Buffer/Long.

plugins: [
    new webpack.IgnorePlugin(/^long$/),
    new webpack.IgnorePlugin(/^buffer$/)
]

@dcodeIO
Copy link
Copy Markdown
Member

dcodeIO commented Dec 18, 2016

This now uses a dynamic require for all optional modules including buffer and long. Give it a shot!

@fnlctrl
Copy link
Copy Markdown
Contributor Author

fnlctrl commented Dec 18, 2016

Works like a charm! Thanks for the awesome work! 👍👍👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants