Skip to content

Commit 111afca

Browse files
IgorMinarhansl
authored andcommitted
fix(@angular-devkit/build-optimizer): support fesm5 paths
This is a workaround for angular#523
1 parent 82d6e26 commit 111afca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/angular_devkit/build_optimizer/src/build-optimizer/build-optimizer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ const whitelistedAngularModules = [
3737
/[\\/]node_modules[\\/]@angular[\\/]cdk[\\/]/,
3838
];
3939

40+
// TODO: this code is very fragile and should be reworked.
41+
// See: https://github.com/angular/devkit/issues/523
4042
const es5AngularModules = [
4143
// Angular 4 packaging format has .es5.js as the extension.
4244
/\.es5\.js$/, // Angular 4
4345
// Angular 5 has esm5 folders.
44-
/[\\/]node_modules[\\/]@angular[\\/][^\\/]+[\\/]esm5[\\/]/,
46+
// Angular 6 has fesm5 folders.
47+
/[\\/]node_modules[\\/]@angular[\\/][^\\/]+[\\/]f?esm5[\\/]/,
4548
// All Angular versions have UMD with es5.
4649
/\.umd\.js$/,
4750
];

0 commit comments

Comments
 (0)