Created by: lukasgjetting
This adds a --silent
option to the react-scripts build
command.
When using the --silent
option neither file sizes nor hosting instructions will be logged.
This is useful when building remotely, as the current amount of "unnecessary" information can really clog the output.
Test plan
- Run
react-scripts build
and see that it prints the same information as before
$ yarn build
yarn run v1.6.0
$ react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
207.02 KB build\static\js\1.6875191b.chunk.js
12.55 KB build\static\js\main.d7e743ce.chunk.js
2.76 KB build\static\css\main.fba159f8.chunk.css
2 KB build\static\css\1.5d61c275.chunk.css
763 B build\static\js\runtime~main.229c360f.js
The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
yarn global add serve
serve -s build
Find out more about deployment here:
http://bit.ly/CRA-deploy
Done in 67.75s.
- Run
react-scripts build --silent
and see that it doesn't print the information specified above
$ yarn build:silent
yarn run v1.6.0
$ react-scripts --silent
Creating an optimized production build...
Compiled successfully.
Done in 17.63s.