Fixed filtering of optional dependencies with injectLocalProject