I wonder if we can approach this in reverse. For instance, after packaging, we often find that there are many unnecessary dependencies lingering in the scene. They tend to hide in the deep corners, and unless you search through each file and code one by one, you might never find them. It would save a lot of time if there was a tool that could pinpoint which specific code in the 'var' package relies on them.
See ZRXS's guide "How to package like a pro".