mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-01 09:01:04 +08:00
* Added the alias for profiling and output change to keep the classNames and functionNames for human readbility * defined isEnvProductionProfile with other isEnv checks * moved the keep_classnames and keep_fnames to terserOptions scope * resolve merge conflict for yarn.lock.cache * revert yarn.lock.cache to master yarn.lock.cache - git checkout origin/master -- packages/create-react-app/yarn.lock.cached * Comment and Boolean Check - I clarified the comment and specified the use case - Changed the environment check to check for the specific true rather than the assumed primitive value as before. * Replaced env with flag - Per suggestion --profile flag used instead of env variable PROFILE_APP * documentation in available scripts section with suggested information * resolved a local git issue. Fixed documentation error. * moved documentation to suggested file - Added a brief summary of profiling in available scripts section. The summary references the production-build document. Which is the file I moved the new documentation into under a new Header for production support. * Update production-build.md Co-authored-by: Ian Sutherland <ian@iansutherland.ca>
40 lines
2.3 KiB
Markdown
40 lines
2.3 KiB
Markdown
---
|
||
id: available-scripts
|
||
title: Available Scripts
|
||
sidebar_label: Available Scripts
|
||
---
|
||
|
||
In the project directory, you can run:
|
||
|
||
## `npm start`
|
||
|
||
Runs the app in the development mode. Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
||
|
||
The page will reload if you make edits. You will also see any lint errors in the console.
|
||
|
||
## `npm test`
|
||
|
||
Launches the test runner in the interactive watch mode. See the section about [running tests](running-tests.md) for more information.
|
||
|
||
## `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. If necessary, classnames and function names can be enabled for profiling purposes. See the [production build](production-build.md) section for more information.
|
||
|
||
Your app is ready to be deployed! See the section about [deployment](deployment.md) for more information about deploying your application to popular hosting providers.
|
||
|
||
## `npm run eject`
|
||
|
||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
|
||
|
||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
||
|
||
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc.) into your project as dependencies in `package.json`. Technically, the distinction between dependencies and development dependencies is pretty arbitrary for front-end apps that produce static bundles.
|
||
|
||
In addition, it used to cause problems with some hosting platforms that didn't install development dependencies (and thus weren't able to build the project on the server or test it right before deployment). You are free to rearrange your dependencies in `package.json` as you see fit.
|
||
|
||
All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
|
||
|
||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
|