Skip to content

Commit 0ebff52

Browse files
committed
add react-dom.shared-subset
1 parent 9400a17 commit 0ebff52

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

packages/next/src/build/webpack-config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@ function createRSCAliases(
442442
alias[
443443
'react$'
444444
] = `next/dist/compiled/react${bundledReactChannel}/react.shared-subset`
445+
446+
alias[
447+
'react-dom$'
448+
] = `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.shared-subset`
445449
}
446450
// Use server rendering stub for RSC and SSR
447451
// x-ref: https://github.com/facebook/react/pull/25436
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
if (process.env.NODE_ENV === 'production') {
4+
module.exports = require('./cjs/react-dom.shared-subset.production.min.js');
5+
} else {
6+
module.exports = require('./cjs/react-dom.shared-subset.development.js');
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
if (process.env.NODE_ENV === 'production') {
4+
module.exports = require('./cjs/react-dom.shared-subset.production.min.js');
5+
} else {
6+
module.exports = require('./cjs/react-dom.shared-subset.development.js');
7+
}

packages/next/webpack.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function makeAppAliases(reactChannel = '') {
2424
const alias = {
2525
react$: `next/dist/compiled/react${reactChannel}`,
2626
'react/shared-subset$': `next/dist/compiled/react${reactChannel}/react.shared-subset`,
27+
'react-dom/shared-subset$': `next/dist/compiled/react-dom${reactChannel}/react-dom.shared-subset`,
2728
'react-dom/server-rendering-stub$': `next/dist/compiled/react-dom${reactChannel}/server-rendering-stub`,
2829
'react-dom$': `next/dist/compiled/react-dom${reactChannel}/server-rendering-stub`,
2930
'react/jsx-runtime$': `next/dist/compiled/react${reactChannel}/jsx-runtime`,
@@ -198,6 +199,9 @@ module.exports = ({ dev, turbo, bundleType, experimental }) => {
198199
react$: `next/dist/compiled/react${
199200
experimental ? '-experimental' : ''
200201
}/react.shared-subset`,
202+
'react-dom$': `next/dist/compiled/react-dom${
203+
experimental ? '-experimental' : ''
204+
}/react-dom.shared-subset`,
201205
},
202206
},
203207
layer: 'react-server',
@@ -210,6 +214,9 @@ module.exports = ({ dev, turbo, bundleType, experimental }) => {
210214
react$: `next/dist/compiled/react${
211215
experimental ? '-experimental' : ''
212216
}/react.shared-subset`,
217+
'react-dom$': `next/dist/compiled/react-dom${
218+
experimental ? '-experimental' : ''
219+
}/react-dom.shared-subset`,
213220
},
214221
},
215222
},

0 commit comments

Comments
 (0)