Skip to content

Commit

Permalink
Merge pull request #7662 from webpack/bugfix/undefined-in-max-size
Browse files Browse the repository at this point in the history
fixes usage of automaticNameDelimiter in cache groups
  • Loading branch information
sokra committed Jul 5, 2018
2 parents 67d932d + 8e8f185 commit 7fc88cd
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 68 deletions.
5 changes: 5 additions & 0 deletions lib/optimize/SplitChunksPlugin.js
Expand Up @@ -126,6 +126,7 @@ module.exports = class SplitChunksPlugin {
cacheGroups: options.cacheGroups,
automaticNameDelimiter: options.automaticNameDelimiter
}),
automaticNameDelimiter: options.automaticNameDelimiter,
fallbackCacheGroup: SplitChunksPlugin.normalizeFallbackCacheGroup(
options.fallbackCacheGroup || {},
options
Expand Down Expand Up @@ -557,6 +558,10 @@ module.exports = class SplitChunksPlugin {
cacheGroupSource.filename !== undefined
? cacheGroupSource.filename
: this.options.filename,
automaticNameDelimiter:
cacheGroupSource.automaticNameDelimiter !== undefined
? cacheGroupSource.automaticNameDelimiter
: this.options.automaticNameDelimiter,
reuseExistingChunk: cacheGroupSource.reuseExistingChunk
};
// For all combination of chunk selection
Expand Down
148 changes: 82 additions & 66 deletions test/__snapshots__/StatsTestCases.test.js.snap

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions test/statsCases/split-chunks-max-size/index.js
Expand Up @@ -41,3 +41,8 @@ import "./in-some-directory/small?2";
import "./in-some-directory/small?3";
import "./in-some-directory/small?4";
import "./in-some-directory/very-big?1";

import "big?1";
import "small?1";
import "small?2";
import "very-big?1";
4 changes: 4 additions & 0 deletions test/statsCases/split-chunks-max-size/node_modules/big.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions test/statsCases/split-chunks-max-size/node_modules/very-big.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions test/statsCases/split-chunks-max-size/webpack.config.js
Expand Up @@ -21,7 +21,8 @@ module.exports = [
optimization: {
splitChunks: {
minSize: 100,
maxSize: 1000
maxSize: 1000,
chunks: "all"
}
},
stats
Expand All @@ -38,7 +39,8 @@ module.exports = [
optimization: {
splitChunks: {
minSize: 100,
maxSize: 1000
maxSize: 1000,
chunks: "all"
}
},
stats
Expand Down

0 comments on commit 7fc88cd

Please sign in to comment.