victorbjelkholm oh that would be great if you are interested in having a crack at at this. I am probably not the best person to explain (kzantow or cliffmeyers would be) but I can try to give you some pointers that may show where to start.
Firstly note that the "front end maven plugin" is used to trigger all the npm builds: https://github.com/eirslett/frontend-maven-plugin
Then note that https://github.com/jenkinsci/js-builder is the infrastructure that is used to build the stuff for each plugin. npm is still being used, gulp, bundler, babel etc - but they are orchestrated by those.
One trick with this is that each plugin gets its own js bundle, and they are loaded up at runtime. Blue ocean is made up of several plugins (and there can be external plugins) - its kind of arbitrary code splitting if you think of it that way.
Each plugin has its own package.json as you can see - and the bundle script is used, eg: https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean-dashboard/package.json - whilst npm is not called directly, the maven front end plugin will call it (in which case it just delegates to gulp). In that blueocean-dashboard plugin, the gulpfile is here: https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean-dashboard/gulpfile.js which I believe really delegates to the js-builder gulpfile (https://github.com/jenkinsci/js-builder/blob/master/gulpfile.js) - perhaps at that level a minified bundle could be made (as long as it doesn't remove code or change things in a way that it can't be loaded at runtime).
Not sure if I have confused things at all... but does that make any sense?
Reading through https://github.com/mishoo/UglifyJS2 - I wonder if using something like that with "mangle" set to false (default is true) and "keep_fnames" set to true (default is false) maybe it would generate bundles that just work? (probably quite a few other options may need to be tweaked)
Need to get some comment from tfennelly on this with how bundling is today