-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
[Webpack 5] Automatic Node.js Polyfills Removed #11282
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
Comments
Here docs https://github.com/webpack/changelog-v5#automatic-nodejs-polyfills-removed Plus you can use |
Thanks! |
Also came across this! https://medium.com/@sanchit3b/how-to-polyfill-node-core-modules-in-webpack-5-905c1f5504a0 |
@evilebottnawi So I'm able to load my own Node polyfills and that's working great I ran into another situation that's pretty interesting, I'm depending on this library which is using Any ideas on how to solve or mock this use case? If this is something that Webpack isn't concerned about, I'm happy to move this issue you to the other libraries repo, but figured this may be something that a lot of users migrating to WP5 will run into. |
You need to open an issue in library for browsing supporting or you can use https://www.npmjs.com/package/process (just put |
Thanks @evilebottnawi I'll move my issue to the other repo |
Hello maintainers! First of all, thanks for working on vfile, I've been using this a lot (especially with remark) and it's been a lifesaver. tl;dr, webpack versions 1-4 used to automatically polyfill node.js libraries and the next version, version 5 doesn't. While migrating a larger project of mine, I ran into a scenario where vfile was breaking because it wasn't loading my `process` polyfill because `vfile` is using `process` as a global. Here is the related webpack issue: webpack/webpack#11282
Found solution for Angular and particularly sockJS nested dev-dependency of eventsource lib. Perhaps not the prettiest solution, though but it still works. So you need the following steps:
So it changes your nested dependency by entirely different lib. |
Hello Webpack team!
First of all, huge thank you to everything that Webpack has become. I've been happily using webpack for 5 or 6 years now and it's critical software for me.
I'm super excited about Webpack 5 (Especially Filesystem cache & Module Federation). I noticed that the nodejs polyfills are removed which a few my projects rely on, that's totally cool ... but I'm not sure what the best way to migrate that code is.
Seems like most instances are in dependencies of dependencies, and after searching through the docs I wasn't able to find a migration for this specific change.
Is there a Webpack 5 compatible way of achieving the same thing? Do I polyfill these libraries in my application code?
Thanks again!
The text was updated successfully, but these errors were encountered: