Using tools like rollup or ng-packagr (for angular) you can create the UMD bundle of your code easily. By default, dependencies will be treated as external dependencies and not bundled in the generated module. For example, ng-packagr does this by default (and it's the proper way since there is no point of creating an Angular Library that contains the code of external dependencies)
The question is how someone could achieve this bundling for some of the external dependencies in UMD with ng-packagr or straight with rollup?
As far as I know, if you declare a module at {externals: []} property of rollup configuration object it will not bundle this to the final UMD. Though any node_modules dependencies even if you do not declare them at externals: [], rollup will not bundle the code to the exported UMD.
Any idea of how this can be achieved?