Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing NgReduxModule includes full RxJS bundle #537

Open
2 of 9 tasks
danielcrisp opened this issue Aug 6, 2018 · 0 comments
Open
2 of 9 tasks

Importing NgReduxModule includes full RxJS bundle #537

danielcrisp opened this issue Aug 6, 2018 · 0 comments

Comments

@danielcrisp
Copy link

This is a...

  • feature request
  • bug report
  • usage question

What toolchain are you using for transpilation/bundling?

  • @angular/cli
  • Custom @ngTools/webpack
  • Raw ngc
  • SystemJS
  • Rollup
  • Other

Environment

NodeJS Version: 8.11.3
Typescript Version: 2.7.2
Angular Version: 6.1.1
@angular-redux/store version: 9.0.0
@angular/cli version: 6.1.2
OS: macOS 10.13.6

Expected Behaviour:

RxJS's pipeable operators should allow the build process to eliminate dead code, meaning that only the utilised operators are included in the final bundle.

Actual Behaviour:

Importing NgReduxModule results in all RxJS operators being included in the final bundle.

Without NgReduxModule (35.96 KB)

screenshot at aug 06 10-45-59

With NgReduxModule (141.77 KB)

screenshot at aug 06 10-46-15

Additional Notes:

I think this is happening because the tsconfig.build.json file is using the module setting of commonjs rather than es2015.

https://github.com/angular-redux/store/blob/master/tsconfig.build.json#L5

Changing this setting, rebuilding the store package, then re-running my app's build results in my RxJS bundle being on 36.89 KB. Much better.

screenshot at aug 06 11-24-35

But unfortunately this setting also results in the store's tests failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant