This project was bootstrapped with Create React App using @ctco-dev/react-scripts mod.
Below you will find some information on how to perform common tasks.
You can find the most recent version of this guide here.
You can find the official CRA docs here
- How it differes from the official CRA
- Common tasks
- Use docker
- 12 Factor app config - 12 Factor approach to maintain configuration.
Runs the app in development mode.
Open http://localhost:3000 to view it in the browser.
Runs the test watcher in an interactive mode.
Builds the app for production to the build
folder.
Runs tslint
linter to analyze your project. Run it with --fix
flag to make it try to fix some errors automatically.
Runs source-map-explorer to analyze the bundle size of your project inside build
directory. Should be run after building the app.
Ejects configuration for your pleasure. Remember! There is no way back! So fairwell, and let the force be with you.
Build and run example:
docker build --tag my-cra-image .
docker run --rm -it --name my-cra-container -p 8080:80 my-cra-image
These commands will run the container app and allow to see it on http://localhost:8080 on your local machine (in case of remote docker host replace localhost with the docker host domain name or ip).
Environment variables filtered by mask (default mask is WEB_APP_
) and injected into window.env
at runtime in development mode (after yarn start
) and in production mode (if running under docker with provided .docker
scripts).
To run project in dev mode and inject variables try to assign them in command line:
WEB_APP_ONE="hello my app" yarn start
or add variables to .env
, .env.local
, .env.development
et c. (see Official CRA doc, but remember, only WEB_APP_
prefixed variables will be injected into window.env
).
To inject environment variables into an application on starting a docker container:
docker run --rm -it --name my-cra-container -e "WEB_APP_ONE=hello my app" -p 8080:80 my-cra-image