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

Commit

Permalink
docs: Emphasise that merge() doesn't accept webpack config objects (#225
Browse files Browse the repository at this point in the history
)

The data structure that is passed to `.merge()` is very similar to a
webpack configuration object, but has a few key differences.

The current docs don't make this clear enough, such that some users
have been trying to pass the output of `.toConfig()` back to `.merge()`,
which can cause errors:
#204 (comment)
  • Loading branch information
edmorley authored Jan 28, 2020
1 parent 33c6ab1 commit d34024d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,12 @@ config.module
### Merging Config

webpack-chain supports merging in an object to the configuration instance which
matches a layout similar to how the webpack-chain schema is laid out. Note that
this is not a webpack configuration object, but you may transform a webpack
configuration object before providing it to webpack-chain to match its layout.
matches a layout similar to how the webpack-chain schema is laid out.

**Note:** This object does not match the webpack configuration schema exactly
(for example the `[name]` keys for entry/rules/plugins), so you may need to transform
webpack configuration objects (such as those output by webpack-chain's `.toConfig()`)
to match the layout below prior to passing to `.merge()`.

```js
config.merge({ devtool: 'source-map' });
Expand Down

0 comments on commit d34024d

Please sign in to comment.