From 553806f612d1c691abc4bbc63a0878b61238f0a4 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Wed, 1 May 2019 08:42:22 -0400 Subject: [PATCH] Show settings; CTA: Netlify-Drop --- .../recipes/build-for-production.md | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/docs/latest/deployment/recipes/build-for-production.md b/docs/latest/deployment/recipes/build-for-production.md index 20864d125..6bc838cac 100644 --- a/docs/latest/deployment/recipes/build-for-production.md +++ b/docs/latest/deployment/recipes/build-for-production.md @@ -83,27 +83,50 @@ the`window.config` equal to our configuration file's value. #### How do I configure my project? -- Modify its values directly -- Create a new config file, and set the `REACT_APP_CONFIG` environement variable -- +The simplest way is to update the existing default config: -The build process knows which file to use based on the `REACT_APP_CONFIG` -environment variable. You can set the value of this environment variable a few -different ways: +_/public/config/default.js_ + +```js +window.config = { + routerBasename: '/', + relativeWebWorkerScriptsPath: '', + servers: { + dicomWeb: [ + { + name: 'DCM4CHEE', + wadoUriRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado', + qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs', + wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs', + qidoSupportsIncludeField: true, + imageRendering: 'wadors', + thumbnailRendering: 'wadors', + requestOptions: { + requestFromBrowser: true, + }, + }, + ], + }, +} +``` + +You can also create a new config file and specify its path relative to the build +output's root by setting the `REACT_APP_CONFIG` environment variable. You can +set the value of this environment variable a few different ways: - [Add a temporary environment variable in your shell](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-temporary-environment-variables-in-your-shell) - [Add environment specific variables in `.env` file(s)](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-development-environment-variables-in-env) -- +- Using the `cross-env` package in an npm script: + - `"build": "cross-env REACT_APP_CONFIG=config/my-config.js react-scripts build"` -* env vars -* `REACT_APP_*` -* config file(s) +After updating the configuration, `yarn run build:web` to generate updated build +output. ## Next Steps ### Deploying our Production Build -TODO: List of recipes +- [Netlify: Drop]() ### Testing Build Output Locally