For my Angular5 application, created stats.json file using webpack-bundle-analyzer npm package. This package is used to analyze the bundles. Observed that the RXJS modules are getting imported twice.

Like there are two operator blocks under RxJS.

  1. One is under RxJS/Operators (highlighetd as green box in below image)
  2. Second is under RxJS/_esma5/Operators (highlighted as red box in below image)

enter image description here

In package.json, I have imported RxJS package as a dependency.

"rxjs": "^5.5.6",

In components, we are using the below format for imports. And which I do F12 on Observable, it points to RxJS/Observable.ts file.

import { Observable } from 'rxjs/Observable';

I am not able to figure out why there are duplicate imports of RxJS. Any pointers will help.

0 Answers