Commit 7e92b0c
📦 NEW: Add lodash dependency (#143)
* Add lodash dependency
I think this should fix #133.
`window.lodash` is already present in Gutenberg.
`window._` is underscore.
If you import `lodash` in the code, it will override `window._` with lodash, which will cause weird bugs in totally unrelated places.
Adding lodash here will prevent webpack from including `lodash` in the output, so it won't cause any conflicts.
### How to test this
#133 only happend on my system, if I installed some other plugins. The easiest way to reproduce it, is to install the `TinyMCE Advanced` plugin.
In your block code:
Add `import { compose } from "@wordpress/compose";` to one of the JavaScript files.
`@wordpress/compose` exports `flowRight` from `lodash` as `compose`, so it imports `lodash`.
This will cause lodash to be included in your build.
I created a repository to show this: https://github.com/martinstuecklschwaiger/gutenberg-example
* 🐛 FIX: Grammar1 parent b715045 commit 7e92b0c
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
0 commit comments