Redoing website in React from Create React App
For more detailed instructions see original instructions here.
We use an npm package called gh-pages
to deploy the site to the gh-pages
branch.
We have an alias for the two commands we need to run to build and deploy the site.
npm run build-deploy
> [email protected] build-deploy /Users/simon/Projects/website-react/website
> react-scripts build && gh-pages -d build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Compiled successfully.
File sizes after gzip:
53.8 KB build/static/js/2.953c6adb.chunk.js
1.55 KB build/static/js/main.3a0ff36b.chunk.js
772 B build/static/js/runtime-main.94a6af97.js
279 B build/static/css/main.d6c5fc23.chunk.css
The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
bit.ly/CRA-deploy
Published