-
-
Notifications
You must be signed in to change notification settings - Fork 469
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
Webpack adds the nodejs shims when they actually not necessary. #194
Comments
@sullenor We need to investigate but not sure if we can fix it easily, as a workaround could you try webpack.config.js module.exports = {
...
node: {
buffer: false
...
}
} I know it's inconvenient and shouldn't be a requirement to use |
@michael-ciniawsky looks like I came to the similar workaround :) thank you! |
Think I am having a similar but slightly different issue. Without style-loader the webpack output:
Importing 1 empty stylesheet into my project causes this:
My webpack config with the work around mentioned above:
EDIT: It looks like the problem is actually with css-loader, not style-loader, and the work around should be Buffer with a capital B not lowercase. Issue Ref from webpack-contrib/css-loader#454 |
Do you want to request a feature or report a bug?
I think it's a bug (not sure).
What is the current behavior?
Webpack includes in the resulting bundle nodejs shims for buffer, process and path modules when they are actually not necessary. It adds about 30kb in the minified bundle.
I faced this issue after updating version of webpack from 1.x to 2.x.
If the current behavior is a bug, please provide the steps to reproduce.
I made a small example, which illustrates the problem: https://github.com/sullenor/webpack-shims and attached the stats files:
What is the expected behavior?
Expected the resulting bundle to have a smaller size: ~3-5kb, not 33kb (minimized).
If this is a feature request, what is motivation or use case for changing the behavior?
No
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
macOs Sierra 10.12.3, nodejs v7.7.2, webpack v2.2.1,
https://github.com/sullenor/webpack-shims/blob/master/package.json#L3-L6
From webpack/webpack#4473
The text was updated successfully, but these errors were encountered: