Replies: 1 comment 9 replies
-
You can try to use https://github.com/tkoenig89/express-static-gzip, using https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In a project we've converted SVG files into SVGZ (gzipped svg) with the webpack CompressionPlugin. This works great whith the transpiled project as served on an apache server with .htaccess using
However, webpack dev server clearly doesn't use the .htaccess config and so browsers are failing to understand the svgz files as no encoding has been set to gzip on the svgz file type.
There is a headers option in the devserver config object, but AFAIK that's for all files and cannot be made conditionally. I also don't know what header to set exactly.
I tried the following, but it didn't work:
How can we set the encoding of already zipped files to gzip on svgz files when served with webpack dev server so browsers know they need to uncompress them?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions