I'm using this in a library which builds to `dist/esm/` and `dist/cjs/`. This plugin fails for nested output directories.