Skip to content

Commit ca46218

Browse files
committed
add defaults for deterministic id plugins
1 parent fe80339 commit ca46218

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

lib/WebpackOptionsApply.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,7 @@ class WebpackOptionsApply extends OptionsApply {
396396
new HashedModuleIdsPlugin().apply(compiler);
397397
break;
398398
case "deterministic":
399-
new DeterministicModuleIdsPlugin({
400-
maxLength: 3
401-
}).apply(compiler);
399+
new DeterministicModuleIdsPlugin().apply(compiler);
402400
break;
403401
case "size":
404402
new OccurrenceModuleIdsPlugin({
@@ -421,9 +419,7 @@ class WebpackOptionsApply extends OptionsApply {
421419
new NamedChunkIdsPlugin().apply(compiler);
422420
break;
423421
case "deterministic":
424-
new DeterministicChunkIdsPlugin({
425-
maxLength: 3
426-
}).apply(compiler);
422+
new DeterministicChunkIdsPlugin().apply(compiler);
427423
break;
428424
case "size":
429425
new OccurrenceChunkIdsPlugin({

lib/ids/DeterministicChunkIdsPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class DeterministicChunkIdsPlugin {
4545
}),
4646
chunk => getFullChunkName(chunk, chunkGraph, requestShortener),
4747
compareNatural,
48-
this.options.maxLength,
48+
this.options.maxLength || 3,
4949
getUsedChunkIds(compilation),
5050
(chunk, id) => {
5151
chunk.id = id;

lib/ids/DeterministicModuleIdsPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class DeterministicModuleIdsPlugin {
4545
compareModulesByPreOrderIndexOrIdentifier(
4646
compilation.moduleGraph
4747
),
48-
this.options.maxLength,
48+
this.options.maxLength || 3,
4949
getUsedModuleIds(compilation),
5050
(module, id) => {
5151
chunkGraph.setModuleId(module, id);

0 commit comments

Comments
 (0)