Add optimization class to webpack-chain typings

This commit is contained in:
Stephanie Yu
2018-05-29 21:03:46 -04:00
parent 14d6d73e6d
commit 05cec665da
2 changed files with 49 additions and 0 deletions
+28
View File
@@ -47,6 +47,7 @@ declare class Config extends __Config.ChainedMap<void> {
module: Config.Module;
node: Config.ChainedMap<this>;
output: Config.Output;
optimization: Config.Optimization;
performance: Config.Performance;
plugins: Config.Plugins<this>;
resolve: Config.Resolve;
@@ -198,6 +199,33 @@ declare namespace Config {
post(): this;
}
class Optimization extends ChainedMap<Config> {
concatenateModules(value: boolean): this;
flagIncludedChunks(value: boolean): this;
mergeDuplicateChunks(value: boolean): this;
minimize(value: boolean): this;
minimizer(value: webpack.Plugin[]): this;
namedChunks(value: boolean): this;
namedModules(value: boolean): this;
nodeEnv(value: boolean | string): this;
noEmitOnErrors(value: boolean): this;
occurrenceOrder(value: boolean): this;
portableRecords(value: boolean): this;
providedExports(value: boolean): this;
removeAvailableModules(value: boolean): this;
removeEmptyChunks(value: boolean): this;
runtimeChunk(value: boolean | "single" | "multiple" | RuntimeChunk): this;
sideEffects(value: boolean): this;
splitChunks(value: SplitChunksOptions): this;
usedExports(value: boolean): this;
}
interface RuntimeChunk {
name: string | Function;
}
interface SplitChunksOptions { [name: string]: any; }
interface LoaderOptions { [name: string]: any; }
class Use extends ChainedMap<Rule> {
@@ -150,6 +150,27 @@ config
.umdNamedDefine(true)
.end()
.optimization
.concatenateModules(true)
.flagIncludedChunks(true)
.mergeDuplicateChunks(true)
.minimize(true)
.minimizer([])
.namedChunks(true)
.namedModules(true)
.nodeEnv(true)
.noEmitOnErrors(true)
.occurrenceOrder(true)
.portableRecords(true)
.providedExports(true)
.removeAvailableModules(true)
.removeEmptyChunks(true)
.runtimeChunk("single")
.sideEffects(true)
.splitChunks({})
.usedExports(true)
.end()
.performance
.hints(true)
.hints('warning')