Is there a way set file paths by an array in CopyWebpackPlugin "from". I mean something like this
new CopyWebpackPlugin([
{
from: [
'./dir1/file1',
'./dir2/file2',
],
to: 'assets/'
}
])
You can't use an array, but globs from minimatch
So something like this will work.
new CopyWebpackPlugin([
{ from: './+(dir1|dir2)/+(file1|file2)', to: 'assets/' },
])
Or you just define multiple from to
new CopyWebpackPlugin([
{ from: './dir1/file1', to: 'assets/' },
{ from: './dir2/file2', to: 'assets/' },
])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With