Fix build scripts in dev-dependencies

Don't return dev-dependencies as dependencies for non-test targets as they're
not actually dependencies!