1

Trying to get smaller bundle I've changed all rxjs imports in my project to new recommended syntax. I import static methods like interval directly from rxjs package, and pipeable operators from rxjs/operators.

I followed the official instruction and included path-mapping and enabled module concatenation in my webpack config.

Still I see no significant change in bundle size. webpack-bundle-analyzer gives the following picture:

Contents of the bundle

On the left there are modules which are really imported in my project. But what is that operators thing on the right? It is about the same size as the separate modules size. Looks like it duplicates those modules, but in concatenated form.

Is this necessary for my bundle? If not, how to remove it?

Anton Rusak
  • 882
  • 4
  • 18

1 Answers1

1

For me the issue was that I was using commonjs modules when webpack needs es6 modules in order to do tree shaking. I detailed the solution in a related issue here: https://stackoverflow.com/a/53850079/628418

Sámal Rasmussen
  • 2,887
  • 35
  • 36