Compression in webpack-dev-server
See original GitHub issueIs there a reason that compress
key is not set in WebpackDevServer config? I tried it on my machine and it made reloads faster and bandwidth usage smaller without any apparent problems.
I can send a PR if that’s okay.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
DevServer - webpack
webpack -dev-server can be used to quickly develop an application. See the development ... Enable gzip compression for everything served: webpack.config.js
Read more >Enable gzip compression on webpack-dev-server?
To configure it in your web pack config, use the compression module. "devServer": { compress: true, before(app) { app.use(compression({})); } ...
Read more >Option to disable the compression for the webpack dev server
Currently the compression is always activated for the webpack dev server. Currently this is a problem if you want to proxy chunked responses ......
Read more >Webpack - Ep. 22 - Web Compression with GZip and Brotili
Last but probably most helpful are 2 technologies for compressing ... webpack Tutorial: devServer & Hot Module Replacement (Live Reload).
Read more >webpack-dev-server - npm
--no-history-api-fallback Do not fallback to /index.html for Single Page Applications. --compress Enable gzip compression. --no-compress Disable ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI, an unexpected consequence of webpack dev server compression is that Server Sent Events over proxy would be buffered, instead of proxied instantaneously.
The issue goes away in production mode, or if I set the webpack dev server
compress
flag to befalse
in dev mode.I bet there are some tricks that would allow compression on without affecting Server Sent Events, but I haven’t figured it out yet.
This has most certainly caused problems with Server-Sent-Events. I’m using this in my project, and have determined that the gzip compression is causing the event connection to close. I’m struggling to find a way to unset this - however, it’s not clear to me why this change was made, since in a development environment it’s a low-impact issue to have non-compressed files served. The trade-off of making SSE unusable doesn’t seem to have been a good call.
Thanks.