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)
With NgReduxModule (141.77 KB)
Additional Notes:
I think this is happening because the tsconfig.build.json file is using the module setting of commonjs rather than es2015.
This is a...
What toolchain are you using for transpilation/bundling?
ngc
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)With
NgReduxModule
(141.77 KB)Additional Notes:
I think this is happening because the tsconfig.build.json file is using the
module
setting ofcommonjs
rather thanes2015
.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.
But unfortunately this setting also results in the store's tests failing.