mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
[Flight] Rename the shared entry point (#20420)
* [Flight] Rename the shared entry point * Shared
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./cjs/react-unstable-index.production.min.server.js');
|
||||
} else {
|
||||
module.exports = require('./cjs/react-unstable-index.development.server.js');
|
||||
}
|
||||
7
packages/react/npm/unstable-shared-subset.js
Normal file
7
packages/react/npm/unstable-shared-subset.js
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./cjs/react-unstable-shared-subset.production.min.js');
|
||||
} else {
|
||||
module.exports = require('./cjs/react-unstable-shared-subset.development.js');
|
||||
}
|
||||
@@ -17,16 +17,16 @@
|
||||
"umd/",
|
||||
"jsx-runtime.js",
|
||||
"jsx-dev-runtime.js",
|
||||
"unstable-index.server.js"
|
||||
"unstable-shared-subset.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"react-server": "./unstable-index.server.js",
|
||||
"react-server": "./unstable-shared-subset.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./index": {
|
||||
"react-server": "./unstable-index.server.js",
|
||||
"react-server": "./unstable-shared-subset.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./build-info.json": "./build-info.json",
|
||||
|
||||
@@ -90,11 +90,11 @@ const bundles = [
|
||||
externals: [],
|
||||
},
|
||||
|
||||
/******* Isomorphic Server Only *******/
|
||||
/******* Isomorphic Shared Subset *******/
|
||||
{
|
||||
bundleTypes: [NODE_DEV, NODE_PROD],
|
||||
moduleType: ISOMORPHIC,
|
||||
entry: 'react/unstable-index.server',
|
||||
entry: 'react/unstable-shared-subset',
|
||||
global: 'React',
|
||||
externals: [],
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@ const forks = Object.freeze({
|
||||
// happens. Other bundles just require('object-assign') anyway.
|
||||
return null;
|
||||
}
|
||||
if (entry === 'react' || entry === 'react/unstable-index.server') {
|
||||
if (entry === 'react' || entry === 'react/unstable-shared-subset') {
|
||||
// Use the forked version that uses ES modules instead of CommonJS.
|
||||
return 'shared/forks/object-assign.inline-umd.js';
|
||||
}
|
||||
@@ -64,7 +64,7 @@ const forks = Object.freeze({
|
||||
// Without this fork, importing `shared/ReactSharedInternals` inside
|
||||
// the `react` package itself would not work due to a cyclical dependency.
|
||||
'shared/ReactSharedInternals': (bundleType, entry, dependencies) => {
|
||||
if (entry === 'react' || entry === 'react/unstable-index.server') {
|
||||
if (entry === 'react' || entry === 'react/unstable-shared-subset') {
|
||||
return 'react/src/ReactSharedInternals.js';
|
||||
}
|
||||
if (!entry.startsWith('react/') && dependencies.indexOf('react') === -1) {
|
||||
|
||||
Reference in New Issue
Block a user