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.
This commit is contained in:
Andrew Clark
2019-10-18 19:35:33 -07:00
committed by GitHub
parent 6fe5d2d8d4
commit ff519a3c1b
2 changed files with 15 additions and 4 deletions
+7 -3
View File
@@ -149,9 +149,13 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run: ./scripts/circleci/add_build_info_json.sh
- run: ./scripts/circleci/update_package_versions.sh
- run: yarn build
- run:
environment:
RELEASE_CHANNEL: stable
command: |
./scripts/circleci/add_build_info_json.sh
./scripts/circleci/update_package_versions.sh
yarn build
- run: echo "stable" >> build/RELEASE_CHANNEL
- persist_to_workspace:
root: build
+8 -1
View File
@@ -25,7 +25,14 @@ const {asyncCopyTo, asyncRimRaf} = require('./utils');
const codeFrame = require('babel-code-frame');
const Wrappers = require('./wrappers');
const __EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';
const RELEASE_CHANNEL = process.env.RELEASE_CHANNEL;
// Default to building in experimental mode. If the release channel is set via
// an environment variable, then check if it's "experimental".
const __EXPERIMENTAL__ =
typeof RELEASE_CHANNEL === 'string'
? RELEASE_CHANNEL === 'experimental'
: true;
// Errors in promises should be fatal.
let loggedErrors = new Set();