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

Code before:
    bundleType === RN_OSS_PROD ||
    bundleType === RN_OSS_PROFILING ||
    bundleType === RN_FB_DEV ||
    bundleType === RN_FB_PROD ||
    bundleType === RN_FB_PROFILING;
  const shouldStayReadable = isFBWWWBundle || isRNBundle || forcePrettyOutput;
  return [
    // Shim any modules that need forking in this environment.
    useForks(forks),
    // Ensure we don't try to bundle any fbjs modules.
    forbidFBJSImports(),
    // Use Node resolution mechanism.
    resolve({
      // skip: externals, // TODO: options.skip was removed in @rollup/plugin-node-resolve 3.0.0
    }),
    // Remove license headers from individual modules
    stripBanner({
      exclude: 'node_modules/**/*',
    }),
    // Compile to ES2015.
    babel(
      getBabelConfig(
        updateBabelOptions,
        bundleType,
        packageName,
        externals,
        !isProduction,
        bundle
      )
    ),
    // Remove 'use strict' from individual source files.
    {
      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__,
        // Enable forked reconciler.
        // NOTE: I did not put much thought into how to configure this.
        __VARIANT__: bundle.enableNewReconciler === true,
      }
    }),
    // The CommonJS plugin *only* exists to pull "art" into "react-art".

Review comment (suggestion):
TODO: `options.skip` was removed in `@rollup/plugin-node-resolve` `3.0.0`

- https://github.com/rollup/plugins/blob/master/packages/node-resolve/CHANGELOG.md#300
  - https://github.com/rollup/rollup-plugin-node-resolve/pull/90

Is there a different value we should be using here now in it's place? (`external`?)

- https://github.com/rollup/plugins/tree/master/packages/node-resolve#resolving-built-ins-like-fs

Code after:
  const isRNBundle =
    bundleType === RN_OSS_DEV ||
    bundleType === RN_OSS_PROD ||
    bundleType === RN_OSS_PROFILING ||
    bundleType === RN_FB_DEV ||
    bundleType === RN_FB_PROD ||
    bundleType === RN_FB_PROFILING;
  const shouldStayReadable = isFBWWWBundle || isRNBundle || forcePrettyOutput;
  return [
    {
      name: 'rollup-plugin-flow-remove-types',
      transform(code) {
        const transformed = flowRemoveTypes(code);
        return {
          code: transformed.toString(),
          map: transformed.generateMap(),
        };
      },
    },
    // Shim any modules that need forking in this environment.
    useForks(forks),
    // Ensure we don't try to bundle any fbjs modules.
    forbidFBJSImports(),
    // Use Node resolution mechanism.
    resolve({
      // skip: externals, // TODO: options.skip was removed in @rollup/plugin-node-resolve 3.0.0
    }),
    // Remove license headers from individual modules
    stripBanner({
      exclude: 'node_modules/**/*',
    }),
    // Compile to ES2015.
    babel(
      getBabelConfig(
        updateBabelOptions,
        bundleType,
        packageName,
        externals,
        !isProduction,
        bundle
      )
    ),
    // Remove 'use strict' from individual source files.
    {
      transform(source) {
        return source.replace(/['"]use strict["']/g, '');
      },
    },
    // Turn __DEV__ and process.env checks into constants.
    replace({
      preventAssignment: true,