Skip to content

Commit

Permalink
add production script explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrifilo committed May 20, 2017
1 parent 5775e2f commit a234f5e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,17 @@ yarn run mongo
To start Jest in watch mode, open a separate tab or terminal window and run:
```bash
yarn run tdd
```
```

#### Production

To build the production version of your app, run this;
```bash
yarn build:prod
```

`build:prod` will run all of the React and Redux source files through babel, and output them to a production folder in the public directory.

In a development environment, `babel-register` runs on the server, transpiling the application source code on the fly. This is great for development since we don't need to re-compile our code everytime we want serve a change in the application code. In a production environment, it's a waste of resources to recompile the same code over and over again when it hasn't changed.

In a production environment, the server will not use `babel-register` to transpile the application source code. Instead, the server will use a pre-compiled copy of the source code in the `public/production` directory. If you make changes to the source code in this environment, you'll need to re-compile the production code before you'll be able to see the change in production.

0 comments on commit a234f5e

Please sign in to comment.