diff --git a/packages/@ngtools/webpack/src/angular_compiler_plugin.ts b/packages/@ngtools/webpack/src/angular_compiler_plugin.ts index 326ef8b98044..a27b0009cf3f 100644 --- a/packages/@ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/@ngtools/webpack/src/angular_compiler_plugin.ts @@ -135,9 +135,13 @@ export class AngularCompilerPlugin implements Tapable { if (!this._entryModule) { return undefined; } - const splitted = this._entryModule.split('#'); + const splitted = this._entryModule.split(/(#[a-zA-Z]+)/); const path = splitted[0]; - const className = splitted[1] || 'default'; + let className = splitted[1] || 'default'; + if (splitted.length >= 3) { + className = splitted[splitted.length - 2]; + } + return { path, className }; }