Skip to content

Commit

Permalink
React Aliases (#57283)
Browse files Browse the repository at this point in the history
This adds aliases to the new react packages being used by Next.js.
  • Loading branch information
wyattjoh authored Oct 23, 2023
1 parent 4661764 commit 9f512f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/next/taskfile-swc.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ module.exports = function (task) {
keepImportAttributes,
emitAssertForImportAttributes: keepImportAttributes,
},
baseUrl: __dirname,
paths: {
'react-dom/server.edge': [
'./compiled/react-dom-experimental/server.edge',
],
'react-dom/static.edge': [
'./compiled/react-dom-experimental/static.edge',
],
},
transform: {
react: {
pragma: 'React.createElement',
Expand Down
3 changes: 3 additions & 0 deletions packages/next/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function makeAppAliases(reactChannel = '') {
'react-server-dom-turbopack/client.edge$': `next/dist/compiled/react-server-dom-turbopack${reactChannel}/client.edge`,
'react-server-dom-turbopack/server.edge$': `next/dist/compiled/react-server-dom-turbopack${reactChannel}/server.edge`,
'react-server-dom-turbopack/server.node$': `next/dist/compiled/react-server-dom-turbopack${reactChannel}/server.node`,
'react-dom/static$': `next/dist/compiled/react-dom-experimental/static`,
'react-dom/static.edge$': `next/dist/compiled/react-dom-experimental/static.edge`,
'react-dom/static.browser$': `next/dist/compiled/react-dom-experimental/static.browser`,
'react-server-dom-webpack/client$': `next/dist/compiled/react-server-dom-webpack${reactChannel}/client`,
'react-server-dom-webpack/client.edge$': `next/dist/compiled/react-server-dom-webpack${reactChannel}/client.edge`,
'react-server-dom-webpack/server.edge$': `next/dist/compiled/react-server-dom-webpack${reactChannel}/server.edge`,
Expand Down

0 comments on commit 9f512f1

Please sign in to comment.