merge-jsons-webpack-plugin
merge-jsons-webpack-plugin copied to clipboard
Fixed error thrown when no files to merge were found.
Fixed error thrown when no files to merge were found. I been stuck with such error when created groupBy rule with a pattern having no matching files. Now instead of throwing
(node:67426) UnhandledPromiseRejectionWarning: TypeError: Reduce of empty array with no initial value at Array.reduce (
)
It will create a blank output file, with empty json {}
In general, just added initial value to .reduce
Just to say we also encountered this problem. When no files are found, it throws an error (same one as above).
Maybe an option for "when no files found" could be passed in, to default to that when nothing is found? Instead of erroring?