Skip to content

Commit 58cacb2

Browse files
feat: indexOf -> includes
1 parent d60a9f5 commit 58cacb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/optimize/CommonsChunkPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Take a look at the "name"/"names" or async/children option.`);
257257
if(Array.isArray(selectedChunks)) {
258258
return allChunks.filter(chunk => {
259259
const notCommmonChunk = chunk !== targetChunk;
260-
const isSelectedChunk = selectedChunks.indexOf(chunk.name) > -1;
260+
const isSelectedChunk = selectedChunks.includes(chunk.name)
261261
return notCommmonChunk && isSelectedChunk;
262262
});
263263
}
@@ -386,7 +386,7 @@ Take a look at the "name"/"names" or async/children option.`);
386386
for(const chunk of chunks) {
387387
if(chunk === targetChunk) continue;
388388
for(const block of chunk.blocksIterable) {
389-
if(block.chunks.indexOf(targetChunk) === -1) {
389+
if(!block.chunks.includes(targetChunk)) {
390390
block.chunks.unshift(targetChunk);
391391
}
392392
targetChunk.addBlock(block);

0 commit comments

Comments
 (0)