From d34024d8d786d219ac9221a7fa57c627d77e8f63 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Tue, 28 Jan 2020 09:33:54 +0000 Subject: [PATCH] docs: Emphasise that merge() doesn't accept webpack config objects (#225) 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: https://github.com/neutrinojs/webpack-chain/issues/204#issuecomment-566432553 --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3d7fe53..1332bd9 100644 --- a/README.md +++ b/README.md @@ -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' });