Skip to content

Commit

Permalink
Include all .js files in the client manifest
Browse files Browse the repository at this point in the history
This is not going to fly for any serious implementation. It pretty much
has to do a pre-compile pass over the server graph to discover the files
to include.

This is enough to run our fixture though.
  • Loading branch information
sebmarkbage committed Feb 7, 2023
1 parent 0d207a6 commit 1720d99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion fixtures/flight/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,14 @@ module.exports = function (webpackEnv) {
// },
// }),
// Fork Start
new ReactFlightWebpackPlugin({isServer: false}),
new ReactFlightWebpackPlugin({
isServer: false,
clientReferences: {
directory: './src',
recursive: true,
include: /\.(js|ts|jsx|tsx)$/,
},
}),
// Fork End
].filter(Boolean),
// Turn off performance processing because we utilize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class ReactFlightWebpackPlugin {
{
directory: '.',
recursive: true,
include: /\.client\.(js|ts|jsx|tsx)$/,
include: /\.(js|ts|jsx|tsx)$/,
},
];
} else if (
Expand Down Expand Up @@ -231,7 +231,7 @@ export default class ReactFlightWebpackPlugin {
// That way we know by the type of dep whether to include.
// It also resolves conflicts when the same module is in multiple chunks.

if (!/\.client\.(js|ts)x?$/.test(module.resource)) {
if (!/\.(js|ts)x?$/.test(module.resource)) {
return;
}

Expand Down

0 comments on commit 1720d99

Please sign in to comment.