Allows target dependencies to be properly calculated across module boundaries, fixing scenarios where a target depends on something inside a module, but the contents of the module are not included in the targeted resources. fixes #1858