@samitouri / QOS-React-2 / commits / edc234c730

Build script should default to experimental (#17144)

`yarn build` defaults to building in experimental mode. To opt-out, set the `RELEASE_CHANNEL` environment variable to `stable`. This is the same as what we do when running tests via `yarn test`, to make local development easier.

Andrew Clark committed Oct 18, 2019 at 19:35 UTC edc234c730731436fdc4d51bb6cef9de3561facc
2 files changed +15 -4
.circleci/config.yml
+7 -3
@@ -149,9 +149,13 @@ jobs:
149 - checkout
150 - *restore_yarn_cache
151 - *run_yarn
152 - - run: ./scripts/circleci/add_build_info_json.sh
153 - - run: ./scripts/circleci/update_package_versions.sh
154 - - run: yarn build
152 + - run:
153 + environment:
154 + RELEASE_CHANNEL: stable
155 + command: |
156 + ./scripts/circleci/add_build_info_json.sh
157 + ./scripts/circleci/update_package_versions.sh
158 + yarn build
159 - run: echo "stable" >> build/RELEASE_CHANNEL
160 - persist_to_workspace:
161 root: build
scripts/rollup/build.js
+8 -1
@@ -25,7 +25,14 @@ const {asyncCopyTo, asyncRimRaf} = require('./utils');
25 const codeFrame = require('babel-code-frame');
26 const Wrappers = require('./wrappers');
27
28 -const __EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';
28 +const RELEASE_CHANNEL = process.env.RELEASE_CHANNEL;
29 +
30 +// Default to building in experimental mode. If the release channel is set via
31 +// an environment variable, then check if it's "experimental".
32 +const __EXPERIMENTAL__ =
33 + typeof RELEASE_CHANNEL === 'string'
34 + ? RELEASE_CHANNEL === 'experimental'
35 + : true;
36
37 // Errors in promises should be fatal.
38 let loggedErrors = new Set();