Webpack: Adds maxSize as option to CacheGroupsOptions and SplitChunksOptions (#29401)

* Adds maxSize as option to CacheGroups and SplitChunks

* Adds test for maxSize

* Adds another minSize/maxSize test and modifies original amount
This commit is contained in:
Kevin O'Neil
2018-10-03 22:58:24 +09:00
committed by John Reilly
parent 8607133d93
commit fa5666117a
2 changed files with 8 additions and 0 deletions

View File

@@ -576,6 +576,8 @@ declare namespace webpack {
priority?: number;
/** Minimal size for the created chunk */
minSize?: number;
/** Maximum size for the created chunk */
maxSize?: number;
/** Minimum number of times a module has to be duplicated until it's considered for splitting */
minChunks?: number;
/** Maximum number of requests which are accepted for on-demand loading */
@@ -592,6 +594,8 @@ declare namespace webpack {
chunks?: "initial" | "async" | "all" | ((chunk: compilation.Chunk) => boolean);
/** Minimal size for the created chunk */
minSize?: number;
/** Maximum size for the created chunk */
maxSize?: number;
/** Minimum number of times a module has to be duplicated until it's considered for splitting */
minChunks?: number;
/** Maximum number of requests which are accepted for on-demand loading */

View File

@@ -632,12 +632,16 @@ configuration = {
mode: "production",
optimization: {
splitChunks: {
minSize: 30000,
maxSize: 50000,
cacheGroups: {
default: false,
vendor: {
chunks: "initial",
test: "node_modules",
name: "vendor",
minSize: 30000,
maxSize: 50000,
enforce: true
}
}