Use custom build output folder when using create-react-app

6324 picture 6324 · Jan 5, 2017 · Viewed 103.4k times · Source

Facebook provides a create-react-app command to build react apps. When we run npm run build, we see output in /build folder.

npm run build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes. Your app is ready to be deployed!

How can we use custom folder instead of /build for the output? Thanks.

Answer

Félix picture Félix · Jun 14, 2017

Edit your package.json:

"build": "react-scripts build && mv build webapp"