Skip to content

Commit edc234c

Browse files
authored
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.
1 parent 3cc5645 commit edc234c

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.circleci/config.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,13 @@ jobs:
149149
- checkout
150150
- *restore_yarn_cache
151151
- *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
155159
- run: echo "stable" >> build/RELEASE_CHANNEL
156160
- persist_to_workspace:
157161
root: build

scripts/rollup/build.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ const {asyncCopyTo, asyncRimRaf} = require('./utils');
2525
const codeFrame = require('babel-code-frame');
2626
const Wrappers = require('./wrappers');
2727

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;
2936

3037
// Errors in promises should be fatal.
3138
let loggedErrors = new Set();

0 commit comments

Comments
 (0)