mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
[ReactFlightWebpackPlugin] Add support for .mjs file extension (#33028)
## Summary Our builds generate files with a `.mjs` file extension. These are currently filtered out by `ReactFlightWebpackPlugin` so I am updating it to support this file extension. This fixes https://github.com/facebook/react/issues/33155 ## How did you test this change? I built the plugin with this change and used `yalc` to test it in my project. I confirmed the expected files now show up in `react-client-manifest.json`
This commit is contained in:
parent
5d04d73274
commit
2bcf06b692
|
|
@ -277,8 +277,14 @@ export default class ReactFlightWebpackPlugin {
|
|||
chunkGroup.chunks.forEach(function (c) {
|
||||
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
|
||||
for (const file of c.files) {
|
||||
if (!file.endsWith('.js')) return;
|
||||
if (file.endsWith('.hot-update.js')) return;
|
||||
if (!(file.endsWith('.js') || file.endsWith('.mjs'))) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
file.endsWith('.hot-update.js') ||
|
||||
file.endsWith('.hot-update.mjs')
|
||||
)
|
||||
return;
|
||||
chunks.push(c.id, file);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user