Skip to content

Commit 91e6b8f

Browse files
committed
refactor: chunk.files was changed from Array to Set
1 parent d23061b commit 91e6b8f

File tree

1 file changed

+3
-3
lines changed
  • config/plugin/react-ssr-dynamic-chunk-webpack-plugin

1 file changed

+3
-3
lines changed

config/plugin/react-ssr-dynamic-chunk-webpack-plugin/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ class ReactSSRDynamicChunkPlugin {
1313
const buildPath = compilation.options.output.path;
1414

1515

16-
compilation.chunks.forEach(chunk => {
16+
[...compilation.chunks].forEach(chunk => {
1717
if (!this.opts.chunk) {
1818
return;
1919
}
2020

21-
const chunks = chunk.files || [];
22-
const asyncChunks = chunk.getAllAsyncChunks();
21+
const chunks = [ ...chunk.files];
22+
const asyncChunks = [ ...chunk.getAllAsyncChunks()];
2323
const mainChunkFile = chunks.length > 0 ? chunks[0] : null;
2424
const mainChunkDir = mainChunkFile ? path.dirname(mainChunkFile) : null;
2525
asyncChunks && asyncChunks.forEach(asyncChunk => {

0 commit comments

Comments
 (0)