I'm going to write up a more detailed and structured doc around all of this wrt what's wrong today with how we generate an use bundles and what I think we need to do to put it right (or more right than it is).
There are a few fundamental things we are doing wrong imo (yes, my fault). I'd really like to put those things right before we try doing things like what's in jenkinsci/js-builder/pull/19. How we allow exports of modules today without properly generating a "dependency bundle" (e.g. how we export some modules in blueocean.js in the blueocean-web plugin) is fundamentally wrong and is eventually going to break badly ... just a matter of time!! jenkinsci/js-builder/pull/19 would very likely make that situation a lot worse imo + make it harder to fix. So, I'm firmly of the opinion that we fix how we generate bundles etc first, and then come back and see how we can make jenkinsci/js-builder/pull/19 work where it'll be on more solid foundations.