Create React App
suggest changecreate-react-app is a React app boilerplate generator created by Facebook. It provides a development environment configured for ease-of-use with minimal setup, including:
- ES6 and JSX transpilation
- Dev server with hot module reloading
- Code linting
- CSS auto-prefixing
- Build script with JS, CSS and image bundling, and sourcemaps
- Jest testing framework
Installation
These steps match the original global install. Current Create React App is started with npx create-react-app my-app instead, and a global install is no longer recommended.
First, install create-react-app globally with the node package manager (npm).
npm install -g create-react-app
Then run the generator in your chosen directory.
create-react-app my-app
Navigate to the newly created directory and run the start script.
cd my-app/
npm start
Configuration
create-react-app is intentionally non-configurable by default. If non-default usage is required, for example, to use a compiled CSS language such as Sass, then the eject command can be used.
npm run eject
This allows editing of all configuration files. N.B. this is an irreversible process.
Alternatives
Alternative React boilerplates include:
Build React App
To build your app for production, run the following command:
npm run build