Skip to content

Commit 1b5cf43

Browse files
baldurhskipjack
authored andcommitted
docs(plugins): use .includes over .indexOf
Consistent usage of `.includes`
1 parent 41615e4 commit 1b5cf43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/plugins/commons-chunk-plugin.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ new webpack.optimize.CommonsChunkPlugin({
217217
if(module.resource && (/^.*\.(css|scss)$/).test(module.resource)) {
218218
return false;
219219
}
220-
return module.context && module.context.indexOf("node_modules") !== -1;
220+
return module.context && module.context.includes("node_modules");
221221
}
222222
})
223223
```
@@ -242,7 +242,7 @@ Since the `vendor` and `manifest` chunk use a different definition for `minChunk
242242
new webpack.optimize.CommonsChunkPlugin({
243243
name: "vendor",
244244
minChunks: function(module){
245-
return module.context && module.context.indexOf("node_modules") !== -1;
245+
return module.context && module.context.includes("node_modules");
246246
}
247247
}),
248248
new webpack.optimize.CommonsChunkPlugin({

0 commit comments

Comments
 (0)