dennis-johnson-dev / webpack-example

This "repro"-sitory attemts to re-create a size difference in bundles when attempting to utilize RxJS lettable operators.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webpack-example

This "repro"-sitory attemts to re-create a size difference in bundles when attempting to utilize RxJS lettable operators.

In this example repo, we have a couple of branches to demonstrate the different cases.

The idea we are after is to be able to import operators like the following:

import { map } from "rxjs/operators";

instead of:

import { map } from "rxjs/operators/map";

While NOT affecting build size.

The master branch contains the "deep imports" method (rxjs/operators/map) which results in a smaller bundle size.

The "operators" branch refers to using rxjs/operators and this results in a larger bundle.

Running example

yarn install
yarn build

Results

Using deep imports (rxjs/operators/<operator-name>), we can see a small bundle size:

Alt text

With using a destructured import from rxjs/operators, we see a larger RxJS footprint:

Alt text

About

This "repro"-sitory attemts to re-create a size difference in bundles when attempting to utilize RxJS lettable operators.

License:MIT License


Languages

Language:JavaScript 92.8%Language:TypeScript 7.2%