Use a different approach when generating code for the bundle. Instead of using a single `load` function which is very loosely type, generate code which keeps the appropriate returned type for each module.