-
-
Notifications
You must be signed in to change notification settings - Fork 27k
serve -s build
not sending gzip-ed files to the browser.
#5620
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
What is your intention of |
@miraage, in create react app after running Output:
Creating an optimized production build...
file sizes after gzip ...
...
You may serve it with a static server:
npm install -g serve
serve -s build Serve is the recommended static server to use for production build for create-react-app. (Disclaimer: I know some information but am not an expert at production configs) But that is a workaround, I would rather use the recommended serve package if an older version achieved the gzip-ing files to the server. |
If you want to use heroku you don't need to use the |
Yeah. We raised this with them before since it used to work. |
I have an app in docker a this was the easiest way to serve it. Should I change the server to something else or will it be resolved? |
serve updated their code to support gzip 🙂, npm uninstall -g serve; npm install -g serve;
serve -s build; serve is now gzipping the files. |
Is this a bug report?
Maybe, issue is with the dependency; more for tracking visibility of
serve -s build
I installed create-react-app on a mac on October 28th.
My current version of serve:
Maybe a solution for this problem is temporarily locking in a version of serve that did support gzip.
looks like this issue and this pr from the serve repo.
(If I figure out the version that has gzip support I will post the update.)
Expected Behavior
Actual Behavior
The serve dependency is not sending gzip-ed files to the browser.

Related to 1908. Running command,
npm run build; serve -s build
Documented further on their issues page, vercel/serve#460
I have a current workaround in that I am manually gzip-ing the files and using express-static-gzip
Here are the files from my workaround so that I could do prod build without ejecting:
Eager to hear other alternatives for solving the problem.
Happy to provide additional information or help in anyway.
The text was updated successfully, but these errors were encountered: