If we are talking about the final bundle itself being compromised, there is not really a technical solution to that other than not using dependencies.