Open CarstenLeue opened 7 years ago
For UMD bundle you need to mention all external libraries in globals
(rollupBaseConfig
). Because UMD bundle need where in globals it can find this library.
Thanks, that already helps a step further. Looks like this has to include the transitive dependencies, too. The new code is:
globals: {
// The key here is library name, and the value is the the name of the global variable name
// the window object.
// See https://github.com/rollup/rollup/wiki/JavaScript-API#globals for more.
'@angular/core': 'ng.core',
'@angular/router': 'ng.router',
'@angular/http': 'ng.http',
'@angular/common': 'ng.common',
'@angular/forms': 'ng.forms',
'@angular/platform-browser': 'ng.platformBrowser',
'@ng-bootstrap/ng-bootstrap': 'bootstrap',
'prod-wch-sdk-ng4': 'prodWchSdkNg4',
'jquery/dist/jquery.slim': '$',
'handlebars/dist/handlebars': 'Handlebars',
'rxjs/ReplaySubject': 'Rx.ReplaySubject',
'rxjs/BehaviorSubject': 'Rx.BehaviorSubject',
'rxjs/Subject': 'Rx.Subject',
'rxjs/Observable': 'Rx.Observable'
},
This still includes the complete @ng-bootstrap/ng-bootstrap
library, which is probably because I don't know what the correct global is for this library.
How can I find out about this?
Normally I find the global name from library's UMD bundle. However, I download ng-bootstrap
from npm and fails to find its global name in UMD bundle.
Men, can you tell me how do you do to get jquery works? I mean, what or how do you import it on your component?
Hi @CarstenLeue ,
have you found a solution to get ng-bootstrap
NOT included in your final umd bundle?
@tinesoft I have succeeded in building a bundle without boostrap, but using a different approach than the quickstart lib. I am now using https://www.npmjs.com/package/ng-packagr to create the bundle, specifying ng-bootstrap as an external library.
The problem of not knowing the correct UMD global persists, however.
I'd like to use your seed to write an Angular lib that in turn depends on another angular lib. In my case this compiles, but the Angular sources are included in the UMD bundle of my lib. How I can prevent this from happening?
My build config is this: