Repository: facebook/react
File: scripts/rollup/build.js (JavaScript)

Code before:
          bundleType,
          packageName,
          externals,
          !isProduction,
          bundle
        )
      ),
      // Remove 'use strict' from individual source files.
      {
        name: "remove 'use strict'",
        transform(source) {
          return source.replace(/['"]use strict["']/g, '');
        },
      },
      // Turn __DEV__ and process.env checks into constants.
      replace({
        preventAssignment: true,
        values: {
          __DEV__: isProduction ? 'false' : 'true',
          __PROFILE__: isProfiling || !isProduction ? 'true' : 'false',
          __UMD__: isUMDBundle ? 'true' : 'false',
          'process.env.NODE_ENV': isProduction
            ? "'production'"
            : "'development'",
          __EXPERIMENTAL__,
          __NEXT_MAJOR__,
        },
      }),
      // The CommonJS plugin *only* exists to pull "art" into "react-art".
      // I'm going to port "art" to ES modules to avoid this problem.
      // Please don't enable this for anything else!
      isUMDBundle && entry === 'react-art' && commonjs(),
      {
        name: 'top-level-definitions',
        renderChunk(source) {
          return Wrappers.wrapWithTopLevelDefinitions(
            source,
            bundleType,
            globalName,
            filename,
            moduleType,
            bundle.wrapWithModuleBoundaries
          );
        },
      },
      // License and haste headers for artifacts with sourcemaps
      // For artifacts with sourcemaps we apply these headers
      // before passing sources to the Closure compiler, which will be building sourcemaps
      needsSourcemaps && {
        name: 'license-and-signature-header-for-artifacts-with-sourcemaps',
        renderChunk(source) {

Review comment (suggestion):
Instead of setting this up as a global I was suggesting that it would just be a constant inside ReactFeatureFlags.js so that it doesn't leak. Since it's a temporary state it's annoying to go around update tests and other things that might be flagged on this.

Code after:
          externals,
          !isProduction,
          bundle
        )
      ),
      // Remove 'use strict' from individual source files.
      {
        name: "remove 'use strict'",
        transform(source) {
          return source.replace(/['"]use strict["']/g, '');
        },
      },
      // Turn __DEV__ and process.env checks into constants.
      replace({
        preventAssignment: true,
        values: {
          __DEV__: isProduction ? 'false' : 'true',
          __PROFILE__: isProfiling || !isProduction ? 'true' : 'false',
          __UMD__: isUMDBundle ? 'true' : 'false',
          'process.env.NODE_ENV': isProduction
            ? "'production'"
            : "'development'",
          __EXPERIMENTAL__,
        },
      }),
      // The CommonJS plugin *only* exists to pull "art" into "react-art".
      // I'm going to port "art" to ES modules to avoid this problem.
      // Please don't enable this for anything else!
      isUMDBundle && entry === 'react-art' && commonjs(),
      {
        name: 'top-level-definitions',
        renderChunk(source) {
          return Wrappers.wrapWithTopLevelDefinitions(
            source,
            bundleType,
            globalName,
            filename,
            moduleType,
            bundle.wrapWithModuleBoundaries
          );
        },
      },
      // License and haste headers for artifacts with sourcemaps
      // For artifacts with sourcemaps we apply these headers
      // before passing sources to the Closure compiler, which will be building sourcemaps
      needsSourcemaps && {
        name: 'license-and-signature-header-for-artifacts-with-sourcemaps',
        renderChunk(source) {
          return Wrappers.wrapWithLicenseHeader(
            source,
            bundleType,