Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Rxjs umd bundles

Tags:

angular

rxjs

I just took a leap from angular QuickStart for 2.0.0-rc2 and updated system-config.ts file to download umd file for rxjs I.e rxjs\bundles\Rx.umd.js

This worked. But I still see in dev tools a lot of individual JS being load like rxjs\observer.js

I see http.umd.js from @angular reference it directly via

import {Observer} from 'rxjs\observer

Is there any way to just load single Rx.umd.js or we have to live with unbundled files as well.

Ps: my dist folder has non bundled rxjs file as well because I am in middle of switching to umd.js which I will correct later.

like image 376
Arpit Agarwal Avatar asked Jun 17 '16 12:06

Arpit Agarwal


1 Answers

It is now possible to ship a small number of UMD or FESM bundles, one for each of the handful of imports (rxjs, rxjs/operators, etc.).

For example:

import { Observable, Subject, ReplaySubject, from, of, range } from 'rxjs';
import { map, filter, switchMap } from 'rxjs/operators';
like image 56
Yuvals Avatar answered Nov 19 '22 01:11

Yuvals