From 8b018a608cce4753ddcb39bfb34e6073d8c361c4 Mon Sep 17 00:00:00 2001 From: Josh Duff Date: Wed, 7 Mar 2018 13:33:45 -0600 Subject: [PATCH 1/2] Adding warning about bug in Webpack --- readme.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/readme.md b/readme.md index 6babd8e..2ae9a9d 100644 --- a/readme.md +++ b/readme.md @@ -9,6 +9,18 @@ Merge the enumerable attributes of two objects deeply. For the old array element-merging algorithm, see [the `arrayMerge` option below](#arraymerge). +## Webpack bug + +If you have `require('deepmerge')` (as opposed to `import merge from 'deepmerge'`) anywhere in your codebase, Webpack 3 and 4 have a bug that [breaks bundling](https://github.com/webpack/webpack/issues/6584). + +If you see `Error: merge is not a function`, add this alias to your Webpack config: + +```js +alias: { + deepmerge$: path.resolve(__dirname, 'node_modules/deepmerge/dist/umd.js'), +} +``` + example ======= From 1b7ec18d4a3749bfdd9022fccf8dbd81175f1f80 Mon Sep 17 00:00:00 2001 From: Josh Duff Date: Wed, 7 Mar 2018 13:35:44 -0600 Subject: [PATCH 2/2] Don't evaluate this part of the readme :-| --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 2ae9a9d..47a55a6 100644 --- a/readme.md +++ b/readme.md @@ -15,7 +15,7 @@ If you have `require('deepmerge')` (as opposed to `import merge from 'deepmerge' If you see `Error: merge is not a function`, add this alias to your Webpack config: -```js +``` alias: { deepmerge$: path.resolve(__dirname, 'node_modules/deepmerge/dist/umd.js'), }