Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): mark rxjs add imports as having s…
Browse files Browse the repository at this point in the history
…ide 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.
  • Loading branch information
clydin authored and filipesilva committed Jul 20, 2020
1 parent 411fe21 commit 6c09023
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,13 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
test: /[\/\\]@angular[\/\\]core[\/\\].+\.js$/,
parser: { system: true },
},
{
// Mark files inside `rxjs/add` as containing side effects.
// If this is fixed upstream and the fixed version becomes the minimum
// supported version, this can be removed.
test: /[\/\\]rxjs[\/\\]add[\/\\].+\.js$/,
sideEffects: true,
},
{
test: /\.m?js$/,
exclude: [/[\/\\](?:core-js|\@babel|tslib)[\/\\]/, /(ngfactory|ngstyle)\.js$/],
Expand Down

0 comments on commit 6c09023

Please sign in to comment.