Skip to content

Commit 51f5e7b

Browse files
authored
[ReactFlightWebpackPlugin] Add support for .mjs file extension
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.
1 parent 143d3e1 commit 51f5e7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ export default class ReactFlightWebpackPlugin {
277277
chunkGroup.chunks.forEach(function (c) {
278278
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
279279
for (const file of c.files) {
280-
if (!file.endsWith('.js')) return;
281-
if (file.endsWith('.hot-update.js')) return;
280+
if (!(file.endsWith('.js') || file.endsWith('.mjs'))) return;
281+
if (file.endsWith('.hot-update.js') || file.endsWith('.hot-update.mjs')) return;
282282
chunks.push(c.id, file);
283283
break;
284284
}

0 commit comments

Comments
 (0)