npx create-react-app プロジェクト名
プロジェクト作成すると下記画面が表示される
Success! Created react-app at /Users/xxx/Myapp/React/learning/react-app
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd react-app
npm start
上記の画面にはコマンド毎の操作説明が表示されており、こちらのコマンドはnpm
の他にyarn
でも実行可能
1.yarn start
又は npm start
・webブラウザを起動
2.yarn build
又は npm run build
・プロジェクトのビルド(プロジェクトのファイルから実際のWebサーバーにアップロードして利用するファイル類を生成する)
3.yarn test
又は npm test
・テストプログラムを実行して、アプリケーションのテストを行う
4.yarn eject
又は npm run eject
・プロジェクトのインジェクトを行う