Something I've noticed in my own plugins @webketje is how metalsmith-branch will only pass a subset of files to a child plugin, but if you use metalsmith.match() it will match against the "global" list of files, and you will end up with some filenames that might not be in your "working" file list.
The fix is using metalsmith.match(pattern, Object.keys(files)) in every plugin, like this: https://github.com/emmercm/metalsmith-reading-time/pull/88/files#diff-92bbac9a308cd5fcf9db165841f2d90ce981baddcb2b1e26cfff170929af3bd1R16
Something I've noticed in my own plugins @webketje is how
metalsmith-branchwill only pass a subset of files to a child plugin, but if you usemetalsmith.match()it will match against the "global" list of files, and you will end up with some filenames that might not be in your "working" file list.The fix is using
metalsmith.match(pattern, Object.keys(files))in every plugin, like this: https://github.com/emmercm/metalsmith-reading-time/pull/88/files#diff-92bbac9a308cd5fcf9db165841f2d90ce981baddcb2b1e26cfff170929af3bd1R16