mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 06:40:35 +08:00
Merge pull request #24361 from eivhyl/webpack4-cacheGroups
webpack: Fixed SplitChunksOptions.cacheGroups not accepting dictionary
This commit is contained in:
2
types/webpack/index.d.ts
vendored
2
types/webpack/index.d.ts
vendored
@@ -551,7 +551,7 @@ declare namespace webpack {
|
||||
/** Give chunks created a name (chunks with equal name are merged) */
|
||||
name?: boolean | string | ((...args: any[]) => any);
|
||||
/** Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks) */
|
||||
cacheGroups?: false | string | ((...args: any[]) => any) | RegExp | CacheGroupsOptions;
|
||||
cacheGroups?: false | string | ((...args: any[]) => any) | RegExp | { [key: string]: CacheGroupsOptions };
|
||||
}
|
||||
interface RuntimeChunkOptions {
|
||||
/** The name or name factory for the runtime chunks. */
|
||||
|
||||
@@ -582,6 +582,22 @@ configuration = {
|
||||
}
|
||||
};
|
||||
|
||||
configuration = {
|
||||
mode: "production",
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
vendor: {
|
||||
chunks: "initial",
|
||||
test: "node_modules",
|
||||
name: "vendor",
|
||||
enforce: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
plugin = new webpack.SplitChunksPlugin({ chunks: "async", minChunks: 2 });
|
||||
|
||||
class SingleEntryDependency extends webpack.compilation.Dependency {}
|
||||
|
||||
Reference in New Issue
Block a user