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

Commit

Permalink
Update webpack-chain.md with upstream changes
Browse files Browse the repository at this point in the history
Adds the `mode` and `optimizations` documentation from:
neutrinojs/webpack-chain#51
  • Loading branch information
edmorley committed Apr 20, 2018
1 parent e687e0a commit 4703e8d
Showing 1 changed file with 52 additions and 2 deletions.
54 changes: 52 additions & 2 deletions docs/webpack-chain.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# webpack-chain: Neutrino configuration API

Use a chaining API to generate and simplify the modification of
webpack 2 and 3 configurations.
webpack configurations.

This documentation corresponds to v4 of webpack-chain, which Neutrino utilizes.

Expand Down Expand Up @@ -302,6 +302,7 @@ neutrino.config
.context(context)
.externals(externals)
.loader(loader)
.mode(mode)
.parallelism(parallelism)
.profile(profile)
.recordsPath(recordsPath)
Expand Down Expand Up @@ -528,6 +529,32 @@ neutrino.config.performance
.assetFilter(assetFilter)
```

#### Configuring optimizations: shorthand methods

```js
neutrino.config.optimization : ChainedMap
neutrino.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 @@ -888,10 +915,12 @@ neutrino.config.merge({
amd,
bail,
cache,
devtool,
context,
devtool,
externals,
loader,
mode,
parallelism,
profile,
recordsPath,
recordsInputPath,
Expand Down Expand Up @@ -943,6 +972,27 @@ neutrino.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

0 comments on commit 4703e8d

Please sign in to comment.