Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix directly using Buffer instead of util.Buffer #571

Merged
merged 1 commit into from
Dec 18, 2016
Merged

Fix directly using Buffer instead of util.Buffer #571

merged 1 commit into from
Dec 18, 2016

Conversation

fnlctrl
Copy link
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
Member

dcodeIO commented Dec 18, 2016

Thanks!

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

dcodeIO commented Dec 18, 2016

Btw, doesn't this cause the same?

@fnlctrl
Copy link
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
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
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