Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6c09023

Browse files
clydinfilipesilva
authored andcommittedJul 20, 2020
fix(@angular-devkit/build-angular): mark rxjs add imports as having side effects
This change prevents webpack from removing the operator add imports from the rxjs package (for example, `import 'rxjs/add/operator/filter';`). The entire rxjs package is currently marked as side effect free from within the rxjs `package.json` but the files in the add directory intentionally contain side effects.
1 parent 411fe21 commit 6c09023

File tree

1 file changed

+7
-0
lines changed
  • packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs

1 file changed

+7
-0
lines changed
 

‎packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts

+7
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,13 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
526526
test: /[\/\\]@angular[\/\\]core[\/\\].+\.js$/,
527527
parser: { system: true },
528528
},
529+
{
530+
// Mark files inside `rxjs/add` as containing side effects.
531+
// If this is fixed upstream and the fixed version becomes the minimum
532+
// supported version, this can be removed.
533+
test: /[\/\\]rxjs[\/\\]add[\/\\].+\.js$/,
534+
sideEffects: true,
535+
},
529536
{
530537
test: /\.m?js$/,
531538
exclude: [/[\/\\](?:core-js|\@babel|tslib)[\/\\]/, /(ngfactory|ngstyle)\.js$/],

0 commit comments

Comments
 (0)
Please sign in to comment.