The latest release introduced breaking change (options validation). Passing an empty array is no longer possible. So it broke cases like
new CopyWebpackPlugin(condition ? ['./something'] : [])
I honestly don't know if it's a valid case to support :)
Change condition [condition ? new CopWebpackPlugin() : false].filter(Boolean), it is expected empty array is not supported
Yeah, I know, that you can write it this way :) But before passing an empty array didn't trigger an error. So, technically, it's a breaking change.
Let's fix it :+1:
Watching this as it broke a number of projects, pinning temporarily to 5.0.x
In next release it will be returned and you can't use empty array
and you can't use empty array
Why?
You can write this check once inside a plugin instead of everyone of us will write this everywhere:
[ patterns.length ? new CopWebpackPlugin({ patterns }) : false ].filter(Boolean)
Most helpful comment
Let's fix it :+1: