1. 'use strict';
    
  2. 
    
  3. const RELEASE_CHANNEL = process.env.RELEASE_CHANNEL;
    
  4. 
    
  5. const __EXPERIMENTAL__ =
    
  6.   typeof RELEASE_CHANNEL === 'string'
    
  7.     ? RELEASE_CHANNEL === 'experimental'
    
  8.     : true;
    
  9. 
    
  10. const bundleTypes = {
    
  11.   NODE_ES2015: 'NODE_ES2015',
    
  12.   ESM_DEV: 'ESM_DEV',
    
  13.   ESM_PROD: 'ESM_PROD',
    
  14.   UMD_DEV: 'UMD_DEV',
    
  15.   UMD_PROD: 'UMD_PROD',
    
  16.   UMD_PROFILING: 'UMD_PROFILING',
    
  17.   NODE_DEV: 'NODE_DEV',
    
  18.   NODE_PROD: 'NODE_PROD',
    
  19.   NODE_PROFILING: 'NODE_PROFILING',
    
  20.   BUN_DEV: 'BUN_DEV',
    
  21.   BUN_PROD: 'BUN_PROD',
    
  22.   FB_WWW_DEV: 'FB_WWW_DEV',
    
  23.   FB_WWW_PROD: 'FB_WWW_PROD',
    
  24.   FB_WWW_PROFILING: 'FB_WWW_PROFILING',
    
  25.   RN_OSS_DEV: 'RN_OSS_DEV',
    
  26.   RN_OSS_PROD: 'RN_OSS_PROD',
    
  27.   RN_OSS_PROFILING: 'RN_OSS_PROFILING',
    
  28.   RN_FB_DEV: 'RN_FB_DEV',
    
  29.   RN_FB_PROD: 'RN_FB_PROD',
    
  30.   RN_FB_PROFILING: 'RN_FB_PROFILING',
    
  31.   BROWSER_SCRIPT: 'BROWSER_SCRIPT',
    
  32. };
    
  33. 
    
  34. const {
    
  35.   NODE_ES2015,
    
  36.   ESM_DEV,
    
  37.   ESM_PROD,
    
  38.   UMD_DEV,
    
  39.   UMD_PROD,
    
  40.   UMD_PROFILING,
    
  41.   NODE_DEV,
    
  42.   NODE_PROD,
    
  43.   NODE_PROFILING,
    
  44.   BUN_DEV,
    
  45.   BUN_PROD,
    
  46.   FB_WWW_DEV,
    
  47.   FB_WWW_PROD,
    
  48.   FB_WWW_PROFILING,
    
  49.   RN_OSS_DEV,
    
  50.   RN_OSS_PROD,
    
  51.   RN_OSS_PROFILING,
    
  52.   RN_FB_DEV,
    
  53.   RN_FB_PROD,
    
  54.   RN_FB_PROFILING,
    
  55.   BROWSER_SCRIPT,
    
  56. } = bundleTypes;
    
  57. 
    
  58. const moduleTypes = {
    
  59.   // React
    
  60.   ISOMORPHIC: 'ISOMORPHIC',
    
  61.   // Individual renderers. They bundle the reconciler. (e.g. ReactDOM)
    
  62.   RENDERER: 'RENDERER',
    
  63.   // Helper packages that access specific renderer's internals. (e.g. TestUtils)
    
  64.   RENDERER_UTILS: 'RENDERER_UTILS',
    
  65.   // Standalone reconciler for third-party renderers.
    
  66.   RECONCILER: 'RECONCILER',
    
  67. };
    
  68. 
    
  69. const {ISOMORPHIC, RENDERER, RENDERER_UTILS, RECONCILER} = moduleTypes;
    
  70. 
    
  71. const bundles = [
    
  72.   /******* Isomorphic *******/
    
  73.   {
    
  74.     bundleTypes: [
    
  75.       UMD_DEV,
    
  76.       UMD_PROD,
    
  77.       UMD_PROFILING,
    
  78.       NODE_DEV,
    
  79.       NODE_PROD,
    
  80.       FB_WWW_DEV,
    
  81.       FB_WWW_PROD,
    
  82.       FB_WWW_PROFILING,
    
  83.       RN_FB_DEV,
    
  84.       RN_FB_PROD,
    
  85.       RN_FB_PROFILING,
    
  86.     ],
    
  87.     moduleType: ISOMORPHIC,
    
  88.     entry: 'react',
    
  89.     global: 'React',
    
  90.     minifyWithProdErrorCodes: false,
    
  91.     wrapWithModuleBoundaries: true,
    
  92.     externals: ['ReactNativeInternalFeatureFlags'],
    
  93.   },
    
  94. 
    
  95.   /******* Isomorphic Shared Subset *******/
    
  96.   {
    
  97.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  98.     moduleType: ISOMORPHIC,
    
  99.     entry: 'react/src/ReactSharedSubset.js',
    
  100.     name: 'react.shared-subset',
    
  101.     global: 'React',
    
  102.     minifyWithProdErrorCodes: true,
    
  103.     wrapWithModuleBoundaries: false,
    
  104.     externals: [],
    
  105.   },
    
  106. 
    
  107.   /******* React JSX Runtime *******/
    
  108.   {
    
  109.     bundleTypes: [
    
  110.       NODE_DEV,
    
  111.       NODE_PROD,
    
  112.       NODE_PROFILING,
    
  113.       // TODO: use on WWW.
    
  114.       RN_FB_DEV,
    
  115.       RN_FB_PROD,
    
  116.       RN_FB_PROFILING,
    
  117.     ],
    
  118.     moduleType: ISOMORPHIC,
    
  119.     entry: 'react/jsx-runtime',
    
  120.     global: 'JSXRuntime',
    
  121.     minifyWithProdErrorCodes: true,
    
  122.     wrapWithModuleBoundaries: false,
    
  123.     externals: ['react', 'ReactNativeInternalFeatureFlags'],
    
  124.   },
    
  125. 
    
  126.   /******* React JSX DEV Runtime *******/
    
  127.   {
    
  128.     bundleTypes: [
    
  129.       NODE_DEV,
    
  130.       NODE_PROD,
    
  131.       NODE_PROFILING,
    
  132.       FB_WWW_DEV,
    
  133.       FB_WWW_PROD,
    
  134.       FB_WWW_PROFILING,
    
  135.       RN_FB_DEV,
    
  136.       RN_FB_PROD,
    
  137.       RN_FB_PROFILING,
    
  138.     ],
    
  139.     moduleType: ISOMORPHIC,
    
  140.     entry: 'react/jsx-dev-runtime',
    
  141.     global: 'JSXDEVRuntime',
    
  142.     minifyWithProdErrorCodes: false,
    
  143.     wrapWithModuleBoundaries: false,
    
  144.     externals: ['react', 'ReactNativeInternalFeatureFlags'],
    
  145.   },
    
  146. 
    
  147.   /******* React DOM *******/
    
  148.   {
    
  149.     bundleTypes: [
    
  150.       UMD_DEV,
    
  151.       UMD_PROD,
    
  152.       UMD_PROFILING,
    
  153.       NODE_DEV,
    
  154.       NODE_PROD,
    
  155.       NODE_PROFILING,
    
  156.       FB_WWW_DEV,
    
  157.       FB_WWW_PROD,
    
  158.       FB_WWW_PROFILING,
    
  159.     ],
    
  160.     moduleType: RENDERER,
    
  161.     entry: 'react-dom',
    
  162.     global: 'ReactDOM',
    
  163.     minifyWithProdErrorCodes: true,
    
  164.     wrapWithModuleBoundaries: true,
    
  165.     externals: ['react'],
    
  166.   },
    
  167. 
    
  168.   /******* React DOM Shared Subset *******/
    
  169.   {
    
  170.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  171.     moduleType: RENDERER,
    
  172.     entry: 'react-dom/src/ReactDOMSharedSubset.js',
    
  173.     name: 'react-dom.shared-subset',
    
  174.     global: 'ReactDOM',
    
  175.     minifyWithProdErrorCodes: false,
    
  176.     wrapWithModuleBoundaries: false,
    
  177.     externals: ['react'],
    
  178.   },
    
  179. 
    
  180.   /******* Test Utils *******/
    
  181.   {
    
  182.     moduleType: RENDERER_UTILS,
    
  183.     bundleTypes: [FB_WWW_DEV, NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
    
  184.     entry: 'react-dom/test-utils',
    
  185.     global: 'ReactTestUtils',
    
  186.     minifyWithProdErrorCodes: false,
    
  187.     wrapWithModuleBoundaries: false,
    
  188.     externals: ['react', 'react-dom'],
    
  189.   },
    
  190. 
    
  191.   /******* React DOM - www - Testing *******/
    
  192.   {
    
  193.     moduleType: RENDERER,
    
  194.     bundleTypes: __EXPERIMENTAL__
    
  195.       ? [FB_WWW_DEV, FB_WWW_PROD, NODE_DEV, NODE_PROD]
    
  196.       : [FB_WWW_DEV, FB_WWW_PROD],
    
  197.     entry: 'react-dom/unstable_testing',
    
  198.     global: 'ReactDOMTesting',
    
  199.     minifyWithProdErrorCodes: true,
    
  200.     wrapWithModuleBoundaries: false,
    
  201.     externals: ['react'],
    
  202.   },
    
  203. 
    
  204.   /******* React DOM Server *******/
    
  205.   {
    
  206.     bundleTypes: [
    
  207.       UMD_DEV,
    
  208.       UMD_PROD,
    
  209.       NODE_DEV,
    
  210.       NODE_PROD,
    
  211.       FB_WWW_DEV,
    
  212.       FB_WWW_PROD,
    
  213.     ],
    
  214.     moduleType: RENDERER,
    
  215.     entry: 'react-dom/src/server/ReactDOMLegacyServerBrowser.js',
    
  216.     name: 'react-dom-server-legacy.browser',
    
  217.     global: 'ReactDOMServer',
    
  218.     minifyWithProdErrorCodes: true,
    
  219.     wrapWithModuleBoundaries: false,
    
  220.     externals: ['react', 'react-dom'],
    
  221.     babel: opts =>
    
  222.       Object.assign({}, opts, {
    
  223.         plugins: opts.plugins.concat([
    
  224.           [require.resolve('@babel/plugin-transform-classes'), {loose: true}],
    
  225.         ]),
    
  226.       }),
    
  227.   },
    
  228.   {
    
  229.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  230.     moduleType: RENDERER,
    
  231.     entry: 'react-dom/src/server/ReactDOMLegacyServerNode.js',
    
  232.     name: 'react-dom-server-legacy.node',
    
  233.     externals: ['react', 'stream', 'react-dom'],
    
  234.     minifyWithProdErrorCodes: false,
    
  235.     wrapWithModuleBoundaries: false,
    
  236.     babel: opts =>
    
  237.       Object.assign({}, opts, {
    
  238.         plugins: opts.plugins.concat([
    
  239.           [require.resolve('@babel/plugin-transform-classes'), {loose: true}],
    
  240.         ]),
    
  241.       }),
    
  242.   },
    
  243. 
    
  244.   /******* React DOM Fizz Server *******/
    
  245.   {
    
  246.     bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
    
  247.     moduleType: RENDERER,
    
  248.     entry: 'react-dom/src/server/react-dom-server.browser.js',
    
  249.     name: 'react-dom-server.browser',
    
  250.     global: 'ReactDOMServer',
    
  251.     minifyWithProdErrorCodes: true,
    
  252.     wrapWithModuleBoundaries: false,
    
  253.     externals: ['react', 'react-dom'],
    
  254.   },
    
  255.   {
    
  256.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  257.     moduleType: RENDERER,
    
  258.     entry: 'react-dom/src/server/react-dom-server.node.js',
    
  259.     name: 'react-dom-server.node',
    
  260.     global: 'ReactDOMServer',
    
  261.     minifyWithProdErrorCodes: false,
    
  262.     wrapWithModuleBoundaries: false,
    
  263.     externals: ['react', 'util', 'crypto', 'async_hooks', 'react-dom'],
    
  264.   },
    
  265.   {
    
  266.     bundleTypes: __EXPERIMENTAL__ ? [FB_WWW_DEV, FB_WWW_PROD] : [],
    
  267.     moduleType: RENDERER,
    
  268.     entry: 'react-server-dom-fb/src/ReactDOMServerFB.js',
    
  269.     global: 'ReactDOMServerStreaming',
    
  270.     minifyWithProdErrorCodes: false,
    
  271.     wrapWithModuleBoundaries: false,
    
  272.     externals: ['react', 'react-dom'],
    
  273.   },
    
  274. 
    
  275.   /******* React DOM Fizz Server Edge *******/
    
  276.   {
    
  277.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  278.     moduleType: RENDERER,
    
  279.     entry: 'react-dom/src/server/react-dom-server.edge.js',
    
  280.     name: 'react-dom-server.edge', // 'node_modules/react/*.js',
    
  281. 
    
  282.     global: 'ReactDOMServer',
    
  283.     minifyWithProdErrorCodes: false,
    
  284.     wrapWithModuleBoundaries: false,
    
  285.     externals: ['react', 'react-dom'],
    
  286.   },
    
  287. 
    
  288.   /******* React DOM Fizz Server Bun *******/
    
  289.   {
    
  290.     bundleTypes: [BUN_DEV, BUN_PROD],
    
  291.     moduleType: RENDERER,
    
  292.     entry: 'react-dom/src/server/react-dom-server.bun.js',
    
  293.     name: 'react-dom-server.bun', // 'node_modules/react/*.js',
    
  294. 
    
  295.     global: 'ReactDOMServer',
    
  296.     minifyWithProdErrorCodes: false,
    
  297.     wrapWithModuleBoundaries: false,
    
  298.     externals: ['react', 'react-dom'],
    
  299.   },
    
  300. 
    
  301.   /******* React DOM Fizz Server External Runtime *******/
    
  302.   {
    
  303.     bundleTypes: [BROWSER_SCRIPT],
    
  304.     moduleType: RENDERER,
    
  305.     entry: 'react-dom/unstable_server-external-runtime',
    
  306.     outputPath: 'unstable_server-external-runtime.js',
    
  307.     global: 'ReactDOMServerExternalRuntime',
    
  308.     minifyWithProdErrorCodes: false,
    
  309.     wrapWithModuleBoundaries: false,
    
  310.     externals: [],
    
  311.   },
    
  312. 
    
  313.   /******* React DOM Server Render Stub *******/
    
  314.   {
    
  315.     bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
    
  316.     moduleType: RENDERER,
    
  317.     entry: 'react-dom/server-rendering-stub',
    
  318.     name: 'react-dom-server-rendering-stub',
    
  319.     global: 'ReactDOMServerRenderingStub',
    
  320.     minifyWithProdErrorCodes: true,
    
  321.     wrapWithModuleBoundaries: false,
    
  322.     externals: ['react'],
    
  323.   },
    
  324. 
    
  325.   /******* React Server DOM Webpack Server *******/
    
  326.   {
    
  327.     bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
    
  328.     moduleType: RENDERER,
    
  329.     entry: 'react-server-dom-webpack/server.browser',
    
  330.     global: 'ReactServerDOMServer',
    
  331.     minifyWithProdErrorCodes: false,
    
  332.     wrapWithModuleBoundaries: false,
    
  333.     externals: ['react', 'react-dom'],
    
  334.   },
    
  335.   {
    
  336.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  337.     moduleType: RENDERER,
    
  338.     entry: 'react-server-dom-webpack/server.node',
    
  339.     global: 'ReactServerDOMServer',
    
  340.     minifyWithProdErrorCodes: false,
    
  341.     wrapWithModuleBoundaries: false,
    
  342.     externals: ['react', 'util', 'crypto', 'async_hooks', 'react-dom'],
    
  343.   },
    
  344.   {
    
  345.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  346.     moduleType: RENDERER,
    
  347.     entry: 'react-server-dom-webpack/server.node.unbundled',
    
  348.     global: 'ReactServerDOMServer',
    
  349.     minifyWithProdErrorCodes: false,
    
  350.     wrapWithModuleBoundaries: false,
    
  351.     externals: ['react', 'util', 'crypto', 'async_hooks', 'react-dom'],
    
  352.   },
    
  353.   {
    
  354.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  355.     moduleType: RENDERER,
    
  356.     entry: 'react-server-dom-webpack/server.edge',
    
  357.     global: 'ReactServerDOMServer',
    
  358.     minifyWithProdErrorCodes: false,
    
  359.     wrapWithModuleBoundaries: false,
    
  360.     externals: ['react', 'util', 'crypto', 'async_hooks', 'react-dom'],
    
  361.   },
    
  362. 
    
  363.   /******* React Server DOM Webpack Client *******/
    
  364.   {
    
  365.     bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
    
  366.     moduleType: RENDERER,
    
  367.     entry: 'react-server-dom-webpack/client.browser',
    
  368.     global: 'ReactServerDOMClient',
    
  369.     minifyWithProdErrorCodes: false,
    
  370.     wrapWithModuleBoundaries: false,
    
  371.     externals: ['react', 'react-dom'],
    
  372.   },
    
  373.   {
    
  374.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  375.     moduleType: RENDERER,
    
  376.     entry: 'react-server-dom-webpack/client.node',
    
  377.     global: 'ReactServerDOMClient',
    
  378.     minifyWithProdErrorCodes: false,
    
  379.     wrapWithModuleBoundaries: false,
    
  380.     externals: ['react', 'react-dom', 'util', 'crypto'],
    
  381.   },
    
  382.   {
    
  383.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  384.     moduleType: RENDERER,
    
  385.     entry: 'react-server-dom-webpack/client.node.unbundled',
    
  386.     global: 'ReactServerDOMClient',
    
  387.     minifyWithProdErrorCodes: false,
    
  388.     wrapWithModuleBoundaries: false,
    
  389.     externals: ['react', 'react-dom', 'util', 'crypto'],
    
  390.   },
    
  391.   {
    
  392.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  393.     moduleType: RENDERER,
    
  394.     entry: 'react-server-dom-webpack/client.edge',
    
  395.     global: 'ReactServerDOMClient',
    
  396.     minifyWithProdErrorCodes: false,
    
  397.     wrapWithModuleBoundaries: false,
    
  398.     externals: ['react', 'react-dom'],
    
  399.   },
    
  400. 
    
  401.   /******* React Server DOM Webpack Plugin *******/
    
  402.   {
    
  403.     bundleTypes: [NODE_ES2015],
    
  404.     moduleType: RENDERER_UTILS,
    
  405.     entry: 'react-server-dom-webpack/plugin',
    
  406.     global: 'ReactServerWebpackPlugin',
    
  407.     minifyWithProdErrorCodes: false,
    
  408.     wrapWithModuleBoundaries: false,
    
  409.     externals: ['fs', 'path', 'url', 'neo-async'],
    
  410.   },
    
  411. 
    
  412.   /******* React Server DOM Webpack Node.js Loader *******/
    
  413.   {
    
  414.     bundleTypes: [ESM_PROD],
    
  415.     moduleType: RENDERER_UTILS,
    
  416.     entry: 'react-server-dom-webpack/node-loader',
    
  417.     global: 'ReactServerWebpackNodeLoader',
    
  418.     minifyWithProdErrorCodes: false,
    
  419.     wrapWithModuleBoundaries: false,
    
  420.     externals: ['acorn'],
    
  421.   },
    
  422. 
    
  423.   /******* React Server DOM Webpack Node.js CommonJS Loader *******/
    
  424.   {
    
  425.     bundleTypes: [NODE_ES2015],
    
  426.     moduleType: RENDERER_UTILS,
    
  427.     entry: 'react-server-dom-webpack/src/ReactFlightWebpackNodeRegister',
    
  428.     name: 'react-server-dom-webpack-node-register',
    
  429.     global: 'ReactFlightWebpackNodeRegister',
    
  430.     minifyWithProdErrorCodes: false,
    
  431.     wrapWithModuleBoundaries: false,
    
  432.     externals: ['url', 'module', 'react-server-dom-webpack/server'],
    
  433.   },
    
  434. 
    
  435.   /******* React Server DOM Turbopack Server *******/
    
  436.   {
    
  437.     bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
    
  438.     moduleType: RENDERER,
    
  439.     entry: 'react-server-dom-turbopack/server.browser',
    
  440.     global: 'ReactServerDOMServer',
    
  441.     minifyWithProdErrorCodes: false,
    
  442.     wrapWithModuleBoundaries: false,
    
  443.     externals: ['react', 'react-dom'],
    
  444.   },
    
  445.   {
    
  446.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  447.     moduleType: RENDERER,
    
  448.     entry: 'react-server-dom-turbopack/server.node',
    
  449.     global: 'ReactServerDOMServer',
    
  450.     minifyWithProdErrorCodes: false,
    
  451.     wrapWithModuleBoundaries: false,
    
  452.     externals: ['react', 'util', 'async_hooks', 'react-dom'],
    
  453.   },
    
  454.   {
    
  455.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  456.     moduleType: RENDERER,
    
  457.     entry: 'react-server-dom-turbopack/server.node.unbundled',
    
  458.     global: 'ReactServerDOMServer',
    
  459.     minifyWithProdErrorCodes: false,
    
  460.     wrapWithModuleBoundaries: false,
    
  461.     externals: ['react', 'util', 'async_hooks', 'react-dom'],
    
  462.   },
    
  463.   {
    
  464.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  465.     moduleType: RENDERER,
    
  466.     entry: 'react-server-dom-turbopack/server.edge',
    
  467.     global: 'ReactServerDOMServer',
    
  468.     minifyWithProdErrorCodes: false,
    
  469.     wrapWithModuleBoundaries: false,
    
  470.     externals: ['react', 'util', 'async_hooks', 'react-dom'],
    
  471.   },
    
  472. 
    
  473.   /******* React Server DOM Turbopack Client *******/
    
  474.   {
    
  475.     bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
    
  476.     moduleType: RENDERER,
    
  477.     entry: 'react-server-dom-turbopack/client.browser',
    
  478.     global: 'ReactServerDOMClient',
    
  479.     minifyWithProdErrorCodes: false,
    
  480.     wrapWithModuleBoundaries: false,
    
  481.     externals: ['react', 'react-dom'],
    
  482.   },
    
  483.   {
    
  484.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  485.     moduleType: RENDERER,
    
  486.     entry: 'react-server-dom-turbopack/client.node',
    
  487.     global: 'ReactServerDOMClient',
    
  488.     minifyWithProdErrorCodes: false,
    
  489.     wrapWithModuleBoundaries: false,
    
  490.     externals: ['react', 'react-dom', 'util'],
    
  491.   },
    
  492.   {
    
  493.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  494.     moduleType: RENDERER,
    
  495.     entry: 'react-server-dom-turbopack/client.node.unbundled',
    
  496.     global: 'ReactServerDOMClient',
    
  497.     minifyWithProdErrorCodes: false,
    
  498.     wrapWithModuleBoundaries: false,
    
  499.     externals: ['react', 'react-dom', 'util'],
    
  500.   },
    
  501.   {
    
  502.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  503.     moduleType: RENDERER,
    
  504.     entry: 'react-server-dom-turbopack/client.edge',
    
  505.     global: 'ReactServerDOMClient',
    
  506.     minifyWithProdErrorCodes: false,
    
  507.     wrapWithModuleBoundaries: false,
    
  508.     externals: ['react', 'react-dom'],
    
  509.   },
    
  510. 
    
  511.   /******* React Server DOM Turbopack Plugin *******/
    
  512.   // There is no plugin the moment because Turbopack
    
  513.   // does not expose a plugin interface yet.
    
  514. 
    
  515.   /******* React Server DOM Turbopack Node.js Loader *******/
    
  516.   {
    
  517.     bundleTypes: [ESM_PROD],
    
  518.     moduleType: RENDERER_UTILS,
    
  519.     entry: 'react-server-dom-turbopack/node-loader',
    
  520.     global: 'ReactServerTurbopackNodeLoader',
    
  521.     minifyWithProdErrorCodes: false,
    
  522.     wrapWithModuleBoundaries: false,
    
  523.     externals: ['acorn'],
    
  524.   },
    
  525. 
    
  526.   /******* React Server DOM Turbopack Node.js CommonJS Loader *******/
    
  527.   {
    
  528.     bundleTypes: [NODE_ES2015],
    
  529.     moduleType: RENDERER_UTILS,
    
  530.     entry: 'react-server-dom-turbopack/src/ReactFlightTurbopackNodeRegister',
    
  531.     name: 'react-server-dom-turbopack-node-register',
    
  532.     global: 'ReactFlightWebpackNodeRegister',
    
  533.     minifyWithProdErrorCodes: false,
    
  534.     wrapWithModuleBoundaries: false,
    
  535.     externals: ['url', 'module', 'react-server-dom-turbopack/server'],
    
  536.   },
    
  537. 
    
  538.   /******* React Server DOM ESM Server *******/
    
  539.   {
    
  540.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  541.     moduleType: RENDERER,
    
  542.     entry: 'react-server-dom-esm/server.node',
    
  543.     minifyWithProdErrorCodes: false,
    
  544.     wrapWithModuleBoundaries: false,
    
  545.     externals: ['react', 'util', 'crypto', 'async_hooks', 'react-dom'],
    
  546.   },
    
  547. 
    
  548.   /******* React Server DOM ESM Client *******/
    
  549.   {
    
  550.     bundleTypes: [NODE_DEV, NODE_PROD, ESM_DEV, ESM_PROD],
    
  551.     moduleType: RENDERER,
    
  552.     entry: 'react-server-dom-esm/client.browser',
    
  553.     minifyWithProdErrorCodes: false,
    
  554.     wrapWithModuleBoundaries: false,
    
  555.     externals: ['react', 'react-dom'],
    
  556.   },
    
  557.   {
    
  558.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  559.     moduleType: RENDERER,
    
  560.     entry: 'react-server-dom-esm/client.node',
    
  561.     minifyWithProdErrorCodes: false,
    
  562.     wrapWithModuleBoundaries: false,
    
  563.     externals: ['react', 'react-dom', 'util', 'crypto'],
    
  564.   },
    
  565. 
    
  566.   /******* React Server DOM ESM Node.js Loader *******/
    
  567.   {
    
  568.     bundleTypes: [ESM_PROD],
    
  569.     moduleType: RENDERER_UTILS,
    
  570.     entry: 'react-server-dom-esm/node-loader',
    
  571.     global: 'ReactServerESMNodeLoader',
    
  572.     minifyWithProdErrorCodes: false,
    
  573.     wrapWithModuleBoundaries: false,
    
  574.     externals: ['acorn'],
    
  575.   },
    
  576. 
    
  577.   /******* React Suspense Test Utils *******/
    
  578.   {
    
  579.     bundleTypes: [NODE_ES2015],
    
  580.     moduleType: RENDERER_UTILS,
    
  581.     entry: 'react-suspense-test-utils',
    
  582.     global: 'ReactSuspenseTestUtils',
    
  583.     minifyWithProdErrorCodes: false,
    
  584.     wrapWithModuleBoundaries: false,
    
  585.     externals: ['react'],
    
  586.   },
    
  587. 
    
  588.   /******* React ART *******/
    
  589.   {
    
  590.     bundleTypes: [
    
  591.       UMD_DEV,
    
  592.       UMD_PROD,
    
  593.       NODE_DEV,
    
  594.       NODE_PROD,
    
  595.       FB_WWW_DEV,
    
  596.       FB_WWW_PROD,
    
  597.     ],
    
  598.     moduleType: RENDERER,
    
  599.     entry: 'react-art',
    
  600.     global: 'ReactART',
    
  601.     externals: ['react'],
    
  602.     minifyWithProdErrorCodes: true,
    
  603.     wrapWithModuleBoundaries: true,
    
  604.     babel: opts =>
    
  605.       Object.assign({}, opts, {
    
  606.         // Include JSX
    
  607.         presets: opts.presets.concat([
    
  608.           require.resolve('@babel/preset-react'),
    
  609.           require.resolve('@babel/preset-flow'),
    
  610.         ]),
    
  611.         plugins: opts.plugins.concat([
    
  612.           [require.resolve('@babel/plugin-transform-classes'), {loose: true}],
    
  613.         ]),
    
  614.       }),
    
  615.   },
    
  616. 
    
  617.   /******* React Native *******/
    
  618.   {
    
  619.     bundleTypes: __EXPERIMENTAL__
    
  620.       ? []
    
  621.       : [RN_FB_DEV, RN_FB_PROD, RN_FB_PROFILING],
    
  622.     moduleType: RENDERER,
    
  623.     entry: 'react-native-renderer',
    
  624.     global: 'ReactNativeRenderer',
    
  625.     externals: ['react-native', 'ReactNativeInternalFeatureFlags'],
    
  626.     minifyWithProdErrorCodes: false,
    
  627.     wrapWithModuleBoundaries: true,
    
  628.     babel: opts =>
    
  629.       Object.assign({}, opts, {
    
  630.         plugins: opts.plugins.concat([
    
  631.           [require.resolve('@babel/plugin-transform-classes'), {loose: true}],
    
  632.         ]),
    
  633.       }),
    
  634.   },
    
  635.   {
    
  636.     bundleTypes: [RN_OSS_DEV, RN_OSS_PROD, RN_OSS_PROFILING],
    
  637.     moduleType: RENDERER,
    
  638.     entry: 'react-native-renderer',
    
  639.     global: 'ReactNativeRenderer',
    
  640.     externals: ['react-native'],
    
  641.     minifyWithProdErrorCodes: false,
    
  642.     wrapWithModuleBoundaries: true,
    
  643.     babel: opts =>
    
  644.       Object.assign({}, opts, {
    
  645.         plugins: opts.plugins.concat([
    
  646.           [require.resolve('@babel/plugin-transform-classes'), {loose: true}],
    
  647.         ]),
    
  648.       }),
    
  649.   },
    
  650. 
    
  651.   /******* React Native Fabric *******/
    
  652.   {
    
  653.     bundleTypes: __EXPERIMENTAL__
    
  654.       ? []
    
  655.       : [RN_FB_DEV, RN_FB_PROD, RN_FB_PROFILING],
    
  656.     moduleType: RENDERER,
    
  657.     entry: 'react-native-renderer/fabric',
    
  658.     global: 'ReactFabric',
    
  659.     externals: ['react-native', 'ReactNativeInternalFeatureFlags'],
    
  660.     minifyWithProdErrorCodes: false,
    
  661.     wrapWithModuleBoundaries: true,
    
  662.     babel: opts =>
    
  663.       Object.assign({}, opts, {
    
  664.         plugins: opts.plugins.concat([
    
  665.           [require.resolve('@babel/plugin-transform-classes'), {loose: true}],
    
  666.         ]),
    
  667.       }),
    
  668.   },
    
  669.   {
    
  670.     bundleTypes: [RN_OSS_DEV, RN_OSS_PROD, RN_OSS_PROFILING],
    
  671.     moduleType: RENDERER,
    
  672.     entry: 'react-native-renderer/fabric',
    
  673.     global: 'ReactFabric',
    
  674.     externals: ['react-native'],
    
  675.     minifyWithProdErrorCodes: false,
    
  676.     wrapWithModuleBoundaries: true,
    
  677.     babel: opts =>
    
  678.       Object.assign({}, opts, {
    
  679.         plugins: opts.plugins.concat([
    
  680.           [require.resolve('@babel/plugin-transform-classes'), {loose: true}],
    
  681.         ]),
    
  682.       }),
    
  683.   },
    
  684. 
    
  685.   /******* React Test Renderer *******/
    
  686.   {
    
  687.     bundleTypes: [
    
  688.       FB_WWW_DEV,
    
  689.       NODE_DEV,
    
  690.       NODE_PROD,
    
  691.       UMD_DEV,
    
  692.       UMD_PROD,
    
  693.       RN_FB_DEV,
    
  694.       RN_FB_PROD,
    
  695.       RN_FB_PROFILING,
    
  696.     ],
    
  697.     moduleType: RENDERER,
    
  698.     entry: 'react-test-renderer',
    
  699.     global: 'ReactTestRenderer',
    
  700.     externals: [
    
  701.       'react',
    
  702.       'scheduler',
    
  703.       'scheduler/unstable_mock',
    
  704.       'ReactNativeInternalFeatureFlags',
    
  705.     ],
    
  706.     minifyWithProdErrorCodes: false,
    
  707.     wrapWithModuleBoundaries: false,
    
  708.     babel: opts =>
    
  709.       Object.assign({}, opts, {
    
  710.         plugins: opts.plugins.concat([
    
  711.           [require.resolve('@babel/plugin-transform-classes'), {loose: true}],
    
  712.         ]),
    
  713.       }),
    
  714.   },
    
  715. 
    
  716.   /******* React Noop Renderer (used for tests) *******/
    
  717.   {
    
  718.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  719.     moduleType: RENDERER,
    
  720.     entry: 'react-noop-renderer',
    
  721.     global: 'ReactNoopRenderer',
    
  722.     minifyWithProdErrorCodes: false,
    
  723.     wrapWithModuleBoundaries: false,
    
  724.     externals: ['react', 'scheduler', 'scheduler/unstable_mock', 'expect'],
    
  725.   },
    
  726. 
    
  727.   /******* React Noop Persistent Renderer (used for tests) *******/
    
  728.   {
    
  729.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  730.     moduleType: RENDERER,
    
  731.     entry: 'react-noop-renderer/persistent',
    
  732.     global: 'ReactNoopRendererPersistent',
    
  733.     minifyWithProdErrorCodes: false,
    
  734.     wrapWithModuleBoundaries: false,
    
  735.     externals: ['react', 'scheduler', 'expect'],
    
  736.   },
    
  737. 
    
  738.   /******* React Noop Server Renderer (used for tests) *******/
    
  739.   {
    
  740.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  741.     moduleType: RENDERER,
    
  742.     entry: 'react-noop-renderer/server',
    
  743.     global: 'ReactNoopRendererServer',
    
  744.     minifyWithProdErrorCodes: false,
    
  745.     wrapWithModuleBoundaries: false,
    
  746.     externals: ['react', 'scheduler', 'expect'],
    
  747.   },
    
  748. 
    
  749.   /******* React Noop Flight Server (used for tests) *******/
    
  750.   {
    
  751.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  752.     moduleType: RENDERER,
    
  753.     entry: 'react-noop-renderer/flight-server',
    
  754.     global: 'ReactNoopFlightServer',
    
  755.     minifyWithProdErrorCodes: false,
    
  756.     wrapWithModuleBoundaries: false,
    
  757.     externals: [
    
  758.       'react',
    
  759.       'scheduler',
    
  760.       'expect',
    
  761.       'react-noop-renderer/flight-modules',
    
  762.     ],
    
  763.   },
    
  764. 
    
  765.   /******* React Noop Flight Client (used for tests) *******/
    
  766.   {
    
  767.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  768.     moduleType: RENDERER,
    
  769.     entry: 'react-noop-renderer/flight-client',
    
  770.     global: 'ReactNoopFlightClient',
    
  771.     minifyWithProdErrorCodes: false,
    
  772.     wrapWithModuleBoundaries: false,
    
  773.     externals: [
    
  774.       'react',
    
  775.       'scheduler',
    
  776.       'expect',
    
  777.       'react-noop-renderer/flight-modules',
    
  778.     ],
    
  779.   },
    
  780. 
    
  781.   /******* React Reconciler *******/
    
  782.   {
    
  783.     bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING],
    
  784.     moduleType: RECONCILER,
    
  785.     entry: 'react-reconciler',
    
  786.     global: 'ReactReconciler',
    
  787.     minifyWithProdErrorCodes: true,
    
  788.     wrapWithModuleBoundaries: false,
    
  789.     externals: ['react'],
    
  790.   },
    
  791. 
    
  792.   /******* React Server *******/
    
  793.   {
    
  794.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  795.     moduleType: RECONCILER,
    
  796.     entry: 'react-server',
    
  797.     global: 'ReactServer',
    
  798.     minifyWithProdErrorCodes: false,
    
  799.     wrapWithModuleBoundaries: false,
    
  800.     externals: ['react'],
    
  801.   },
    
  802. 
    
  803.   /******* React Flight Server *******/
    
  804.   {
    
  805.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  806.     moduleType: RECONCILER,
    
  807.     entry: 'react-server/flight',
    
  808.     global: 'ReactFlightServer',
    
  809.     minifyWithProdErrorCodes: false,
    
  810.     wrapWithModuleBoundaries: false,
    
  811.     externals: ['react'],
    
  812.   },
    
  813. 
    
  814.   /******* React Flight Client *******/
    
  815.   {
    
  816.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  817.     moduleType: RECONCILER,
    
  818.     entry: 'react-client/flight',
    
  819.     global: 'ReactFlightClient',
    
  820.     minifyWithProdErrorCodes: true,
    
  821.     wrapWithModuleBoundaries: false,
    
  822.     externals: ['react'],
    
  823.   },
    
  824. 
    
  825.   /******* Reconciler Reflection *******/
    
  826.   {
    
  827.     moduleType: RENDERER_UTILS,
    
  828.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  829.     entry: 'react-reconciler/reflection',
    
  830.     global: 'ReactFiberTreeReflection',
    
  831.     minifyWithProdErrorCodes: true,
    
  832.     wrapWithModuleBoundaries: false,
    
  833.     externals: [],
    
  834.   },
    
  835. 
    
  836.   /******* Reconciler Constants *******/
    
  837.   {
    
  838.     moduleType: RENDERER_UTILS,
    
  839.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  840.     entry: 'react-reconciler/constants',
    
  841.     global: 'ReactReconcilerConstants',
    
  842.     minifyWithProdErrorCodes: true,
    
  843.     wrapWithModuleBoundaries: false,
    
  844.     externals: [],
    
  845.   },
    
  846. 
    
  847.   /******* React Is *******/
    
  848.   {
    
  849.     bundleTypes: [
    
  850.       NODE_DEV,
    
  851.       NODE_PROD,
    
  852.       FB_WWW_DEV,
    
  853.       FB_WWW_PROD,
    
  854.       UMD_DEV,
    
  855.       UMD_PROD,
    
  856.       RN_FB_DEV,
    
  857.       RN_FB_PROD,
    
  858.       RN_FB_PROFILING,
    
  859.     ],
    
  860.     moduleType: ISOMORPHIC,
    
  861.     entry: 'react-is',
    
  862.     global: 'ReactIs',
    
  863.     minifyWithProdErrorCodes: true,
    
  864.     wrapWithModuleBoundaries: false,
    
  865.     externals: ['ReactNativeInternalFeatureFlags'],
    
  866.   },
    
  867. 
    
  868.   /******* React Debug Tools *******/
    
  869.   {
    
  870.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  871.     moduleType: ISOMORPHIC,
    
  872.     entry: 'react-debug-tools',
    
  873.     global: 'ReactDebugTools',
    
  874.     minifyWithProdErrorCodes: false,
    
  875.     wrapWithModuleBoundaries: false,
    
  876.     externals: [],
    
  877.   },
    
  878. 
    
  879.   /******* React Cache (experimental, old) *******/
    
  880.   {
    
  881.     // This is only used by our own tests.
    
  882.     // We can delete it later.
    
  883.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  884.     moduleType: ISOMORPHIC,
    
  885.     entry: 'react-cache',
    
  886.     global: 'ReactCacheOld',
    
  887.     minifyWithProdErrorCodes: false,
    
  888.     wrapWithModuleBoundaries: false,
    
  889.     externals: ['react', 'scheduler'],
    
  890.   },
    
  891. 
    
  892.   /******* Hook for managing subscriptions safely *******/
    
  893.   {
    
  894.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  895.     moduleType: ISOMORPHIC,
    
  896.     entry: 'use-subscription',
    
  897.     global: 'useSubscription',
    
  898.     minifyWithProdErrorCodes: true,
    
  899.     wrapWithModuleBoundaries: true,
    
  900.     externals: ['react'],
    
  901.   },
    
  902. 
    
  903.   /******* useSyncExternalStore *******/
    
  904.   {
    
  905.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  906.     moduleType: ISOMORPHIC,
    
  907.     entry: 'use-sync-external-store',
    
  908.     global: 'useSyncExternalStore',
    
  909.     minifyWithProdErrorCodes: true,
    
  910.     wrapWithModuleBoundaries: true,
    
  911.     externals: ['react'],
    
  912.   },
    
  913. 
    
  914.   /******* useSyncExternalStore (shim) *******/
    
  915.   {
    
  916.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  917.     moduleType: ISOMORPHIC,
    
  918.     entry: 'use-sync-external-store/shim',
    
  919.     global: 'useSyncExternalStore',
    
  920.     minifyWithProdErrorCodes: false,
    
  921.     wrapWithModuleBoundaries: true,
    
  922.     externals: ['react'],
    
  923.   },
    
  924. 
    
  925.   /******* useSyncExternalStore (shim, native) *******/
    
  926.   {
    
  927.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  928.     moduleType: ISOMORPHIC,
    
  929.     entry: 'use-sync-external-store/shim/index.native',
    
  930.     global: 'useSyncExternalStore',
    
  931.     minifyWithProdErrorCodes: false,
    
  932.     wrapWithModuleBoundaries: true,
    
  933.     externals: ['react'],
    
  934.   },
    
  935. 
    
  936.   /******* useSyncExternalStoreWithSelector *******/
    
  937.   {
    
  938.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  939.     moduleType: ISOMORPHIC,
    
  940.     entry: 'use-sync-external-store/with-selector',
    
  941.     global: 'useSyncExternalStoreWithSelector',
    
  942.     minifyWithProdErrorCodes: false,
    
  943.     wrapWithModuleBoundaries: true,
    
  944.     externals: ['react'],
    
  945.   },
    
  946. 
    
  947.   /******* useSyncExternalStoreWithSelector (shim) *******/
    
  948.   {
    
  949.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  950.     moduleType: ISOMORPHIC,
    
  951.     entry: 'use-sync-external-store/shim/with-selector',
    
  952.     global: 'useSyncExternalStoreWithSelector',
    
  953.     minifyWithProdErrorCodes: false,
    
  954.     wrapWithModuleBoundaries: true,
    
  955.     externals: ['react', 'use-sync-external-store/shim'],
    
  956.   },
    
  957. 
    
  958.   /******* React Scheduler (experimental) *******/
    
  959.   {
    
  960.     bundleTypes: [
    
  961.       NODE_DEV,
    
  962.       NODE_PROD,
    
  963.       FB_WWW_DEV,
    
  964.       FB_WWW_PROD,
    
  965.       FB_WWW_PROFILING,
    
  966.       RN_FB_DEV,
    
  967.       RN_FB_PROD,
    
  968.       RN_FB_PROFILING,
    
  969.     ],
    
  970.     moduleType: ISOMORPHIC,
    
  971.     entry: 'scheduler',
    
  972.     global: 'Scheduler',
    
  973.     minifyWithProdErrorCodes: true,
    
  974.     wrapWithModuleBoundaries: true,
    
  975.     externals: ['ReactNativeInternalFeatureFlags'],
    
  976.   },
    
  977. 
    
  978.   /******* React Scheduler Mock (experimental) *******/
    
  979.   {
    
  980.     bundleTypes: [
    
  981.       UMD_DEV,
    
  982.       UMD_PROD,
    
  983.       NODE_DEV,
    
  984.       NODE_PROD,
    
  985.       FB_WWW_DEV,
    
  986.       FB_WWW_PROD,
    
  987.       RN_FB_DEV,
    
  988.       RN_FB_PROD,
    
  989.     ],
    
  990.     moduleType: ISOMORPHIC,
    
  991.     entry: 'scheduler/unstable_mock',
    
  992.     global: 'SchedulerMock',
    
  993.     minifyWithProdErrorCodes: false,
    
  994.     wrapWithModuleBoundaries: false,
    
  995.     externals: ['ReactNativeInternalFeatureFlags'],
    
  996.   },
    
  997. 
    
  998.   /******* React Scheduler Native *******/
    
  999.   {
    
  1000.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  1001.     moduleType: ISOMORPHIC,
    
  1002.     entry: 'scheduler/index.native',
    
  1003.     global: 'SchedulerNative',
    
  1004.     minifyWithProdErrorCodes: false,
    
  1005.     wrapWithModuleBoundaries: false,
    
  1006.     externals: ['ReactNativeInternalFeatureFlags'],
    
  1007.   },
    
  1008. 
    
  1009.   /******* React Scheduler Post Task (experimental) *******/
    
  1010.   {
    
  1011.     bundleTypes: [
    
  1012.       NODE_DEV,
    
  1013.       NODE_PROD,
    
  1014.       FB_WWW_DEV,
    
  1015.       FB_WWW_PROD,
    
  1016.       FB_WWW_PROFILING,
    
  1017.     ],
    
  1018.     moduleType: ISOMORPHIC,
    
  1019.     entry: 'scheduler/unstable_post_task',
    
  1020.     global: 'SchedulerPostTask',
    
  1021.     minifyWithProdErrorCodes: true,
    
  1022.     wrapWithModuleBoundaries: false,
    
  1023.     externals: [],
    
  1024.   },
    
  1025. 
    
  1026.   /******* Jest React (experimental) *******/
    
  1027.   {
    
  1028.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  1029.     moduleType: ISOMORPHIC,
    
  1030.     entry: 'jest-react',
    
  1031.     global: 'JestReact',
    
  1032.     minifyWithProdErrorCodes: false,
    
  1033.     wrapWithModuleBoundaries: false,
    
  1034.     externals: ['react', 'scheduler', 'scheduler/unstable_mock'],
    
  1035.   },
    
  1036. 
    
  1037.   /******* ESLint Plugin for Hooks *******/
    
  1038.   {
    
  1039.     // TODO: it's awkward to create a bundle for this but if we don't, the package
    
  1040.     // won't get copied. We also can't create just DEV bundle because it contains a
    
  1041.     // NODE_ENV check inside. We should probably tweak our build process to allow
    
  1042.     // "raw" packages that don't get bundled.
    
  1043.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  1044.     moduleType: ISOMORPHIC,
    
  1045.     entry: 'eslint-plugin-react-hooks',
    
  1046.     global: 'ESLintPluginReactHooks',
    
  1047.     minifyWithProdErrorCodes: false,
    
  1048.     wrapWithModuleBoundaries: false,
    
  1049.     externals: [],
    
  1050.   },
    
  1051. 
    
  1052.   /******* React Fresh *******/
    
  1053.   {
    
  1054.     bundleTypes: [NODE_DEV, NODE_PROD],
    
  1055.     moduleType: ISOMORPHIC,
    
  1056.     entry: 'react-refresh/babel',
    
  1057.     global: 'ReactFreshBabelPlugin',
    
  1058.     minifyWithProdErrorCodes: false,
    
  1059.     wrapWithModuleBoundaries: false,
    
  1060.     externals: [],
    
  1061.   },
    
  1062.   {
    
  1063.     bundleTypes: [NODE_DEV, NODE_PROD, FB_WWW_DEV],
    
  1064.     moduleType: ISOMORPHIC,
    
  1065.     entry: 'react-refresh/runtime',
    
  1066.     global: 'ReactFreshRuntime',
    
  1067.     minifyWithProdErrorCodes: false,
    
  1068.     wrapWithModuleBoundaries: false,
    
  1069.     externals: [],
    
  1070.   },
    
  1071. ];
    
  1072. 
    
  1073. // Based on deep-freeze by substack (public domain)
    
  1074. function deepFreeze(o) {
    
  1075.   Object.freeze(o);
    
  1076.   Object.getOwnPropertyNames(o).forEach(function (prop) {
    
  1077.     if (
    
  1078.       o[prop] !== null &&
    
  1079.       (typeof o[prop] === 'object' || typeof o[prop] === 'function') &&
    
  1080.       !Object.isFrozen(o[prop])
    
  1081.     ) {
    
  1082.       deepFreeze(o[prop]);
    
  1083.     }
    
  1084.   });
    
  1085.   return o;
    
  1086. }
    
  1087. 
    
  1088. // Don't accidentally mutate config as part of the build
    
  1089. deepFreeze(bundles);
    
  1090. deepFreeze(bundleTypes);
    
  1091. deepFreeze(moduleTypes);
    
  1092. 
    
  1093. function getFilename(bundle, bundleType) {
    
  1094.   let name = bundle.name || bundle.entry;
    
  1095.   const globalName = bundle.global;
    
  1096.   // we do this to replace / to -, for react-dom/server
    
  1097.   name = name.replace('/index.', '.').replace('/', '-');
    
  1098.   switch (bundleType) {
    
  1099.     case NODE_ES2015:
    
  1100.       return `${name}.js`;
    
  1101.     case BUN_DEV:
    
  1102.       return `${name}.development.js`;
    
  1103.     case BUN_PROD:
    
  1104.       return `${name}.production.min.js`;
    
  1105.     case ESM_DEV:
    
  1106.       return `${name}.development.js`;
    
  1107.     case ESM_PROD:
    
  1108.       return `${name}.production.min.js`;
    
  1109.     case UMD_DEV:
    
  1110.       return `${name}.development.js`;
    
  1111.     case UMD_PROD:
    
  1112.       return `${name}.production.min.js`;
    
  1113.     case UMD_PROFILING:
    
  1114.       return `${name}.profiling.min.js`;
    
  1115.     case NODE_DEV:
    
  1116.       return `${name}.development.js`;
    
  1117.     case NODE_PROD:
    
  1118.       return `${name}.production.min.js`;
    
  1119.     case NODE_PROFILING:
    
  1120.       return `${name}.profiling.min.js`;
    
  1121.     case FB_WWW_DEV:
    
  1122.     case RN_OSS_DEV:
    
  1123.     case RN_FB_DEV:
    
  1124.       return `${globalName}-dev.js`;
    
  1125.     case FB_WWW_PROD:
    
  1126.     case RN_OSS_PROD:
    
  1127.     case RN_FB_PROD:
    
  1128.       return `${globalName}-prod.js`;
    
  1129.     case FB_WWW_PROFILING:
    
  1130.     case RN_FB_PROFILING:
    
  1131.     case RN_OSS_PROFILING:
    
  1132.       return `${globalName}-profiling.js`;
    
  1133.     case BROWSER_SCRIPT:
    
  1134.       return `${name}.js`;
    
  1135.   }
    
  1136. }
    
  1137. 
    
  1138. module.exports = {
    
  1139.   bundleTypes,
    
  1140.   moduleTypes,
    
  1141.   bundles,
    
  1142.   getFilename,
    
  1143. };