Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Update README.md with optimization documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Walker Burgin committed Apr 16, 2018
1 parent 26c630a commit 82f25bd
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 16 deletions.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,32 @@ config.performance
.assetFilter(assetFilter)
```

#### Configuring optimizations: shorthand methods

```js
config.optimization : ChainedMap
config.optimization
.concatenateModules(concatenateModules)
.flagIncludedChunks(flagIncludedChunks)
.mergeDuplicateChunks(mergeDuplicateChunks)
.minimize(minimize)
.minimizer(minimizer)
.namedChunks(namedChunks)
.namedModules(namedModules)
.nodeEnv(nodeEnv)
.noEmitOnErrors(noEmitOnErrors)
.occurrenceOrder(occurrenceOrder)
.portableRecords(portableRecords)
.providedExports(providedExports)
.removeAvailableModules(removeAvailableModules)
.removeEmptyChunks(removeEmptyChunks)
.runtimeChunk(runtimeChunk)
.sideEffects(sideEffects)
.splitChunks(splitChunks)
.usedExports(usedExports)
```

#### Config plugins

```js
Expand Down Expand Up @@ -930,10 +956,12 @@ config.merge({
amd,
bail,
cache,
devtool,
context,
devtool,
externals,
loader,
mode,
parallelism,
profile,
recordsPath,
recordsInputPath,
Expand Down Expand Up @@ -985,6 +1013,27 @@ config.merge({
[key]: value
},
optimizations: {
concatenateModules,
flagIncludedChunks,
mergeDuplicateChunks,
minimize,
minimizer,
namedChunks,
namedModules,
nodeEnv,
noEmitOnErrors,
occurrenceOrder,
portableRecords,
providedExports,
removeAvailableModules,
removeEmptyChunks,
runtimeChunk,
sideEffects,
splitChunks,
usedExports,
},
performance: {
[key]: value,
Expand Down
2 changes: 1 addition & 1 deletion src/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ module.exports = class extends ChainedMap {
'amd',
'bail',
'cache',
'devtool',
'context',
'devtool',
'externals',
'loader',
'mode',
Expand Down
28 changes: 14 additions & 14 deletions src/Optimization.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ module.exports = class extends ChainedMap {
constructor(parent) {
super(parent);
this.extend([
'removeAvailableModules',
'removeEmptyChunks',
'mergeDuplicateChunks',
'flagIncludedChunks',
'occurrenceOrder',
'sideEffects',
'providedExports',
'usedExports',
'concatenateModules',
'splitChunks',
'runtimeChunk',
'noEmitOnErrors',
'namedModules',
'namedChunks',
'portableRecords',
'flagIncludedChunks',
'mergeDuplicateChunks',
'minimize',
'minimizer',
'namedChunks',
'namedModules',
'nodeEnv',
'noEmitOnErrors',
'occurrenceOrder',
'portableRecords',
'providedExports',
'removeAvailableModules',
'removeEmptyChunks',
'runtimeChunk',
'sideEffects',
'splitChunks',
'usedExports',
]);
}
};

0 comments on commit 82f25bd

Please sign in to comment.