`serve -s build` not sending gzip-ed files to the browser.
See original GitHub issueIs 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:
serve --version
10.0.2
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, https://github.com/zeit/serve/issues/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:
- “alternative” script in package.json
- “server.js” file for express
- Also notice I had to add express and express-static to the package.json
Eager to hear other alternatives for solving the problem. Happy to provide additional information or help in anyway.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
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?
You **may** serve it with a static server
means “you can try to see how your apps works after being built for production usage”. Just think about what app would serve faster: the one which was written in C++ or NodeJS?If you want to use heroku you don’t need to use the
serve
package. Link with instructions for heroku deployment.