fix(compiler): Do not embed templateUrl in view factories in non-debug mode. (#11818)
Fixes #11117.
This commit is contained in:
parent
425c1e6042
commit
3a5b4882bc
|
@ -514,18 +514,19 @@ function createViewFactory(
|
|||
}
|
||||
if (view.viewIndex === 0) {
|
||||
var animationsExpr = o.literalMap(view.animations.map(entry => [entry.name, entry.fnExp]));
|
||||
initRenderCompTypeStmts = [new o.IfStmt(renderCompTypeVar.identical(o.NULL_EXPR), [
|
||||
renderCompTypeVar
|
||||
.set(ViewConstructorVars.viewUtils.callMethod(
|
||||
'createRenderComponentType',
|
||||
[
|
||||
o.literal(templateUrlInfo),
|
||||
o.literal(view.component.template.ngContentSelectors.length),
|
||||
ViewEncapsulationEnum.fromValue(view.component.template.encapsulation), view.styles,
|
||||
animationsExpr
|
||||
]))
|
||||
.toStmt()
|
||||
])];
|
||||
initRenderCompTypeStmts = [new o.IfStmt(
|
||||
renderCompTypeVar.identical(o.NULL_EXPR),
|
||||
[renderCompTypeVar
|
||||
.set(ViewConstructorVars.viewUtils.callMethod(
|
||||
'createRenderComponentType',
|
||||
[
|
||||
view.genConfig.genDebugInfo ? o.literal(templateUrlInfo) : o.literal(''),
|
||||
o.literal(view.component.template.ngContentSelectors.length),
|
||||
ViewEncapsulationEnum.fromValue(view.component.template.encapsulation),
|
||||
view.styles,
|
||||
animationsExpr,
|
||||
]))
|
||||
.toStmt()])];
|
||||
}
|
||||
return o
|
||||
.fn(viewFactoryArgs, initRenderCompTypeStmts.concat([new o.ReturnStatement(
|
||||
|
|
Loading…
Reference in New Issue