Take a UMD bundle and convert it to an iife
and specify the globalName that is assigned.
npm install babel-plugin-transform-umd-to-iife --save-dev
{
plugins: [
['babel-plugin-transform-umd-to-iife'), { globalName: 'MyGlobalName' }],
],
}
I tried to make this so it would work for common formats of umd, but I would not be surprised if some pacakges have issues. If you find examples of pacakges that do not work, let me know :)