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) {
|
if (view.viewIndex === 0) {
|
||||||
var animationsExpr = o.literalMap(view.animations.map(entry => [entry.name, entry.fnExp]));
|
var animationsExpr = o.literalMap(view.animations.map(entry => [entry.name, entry.fnExp]));
|
||||||
initRenderCompTypeStmts = [new o.IfStmt(renderCompTypeVar.identical(o.NULL_EXPR), [
|
initRenderCompTypeStmts = [new o.IfStmt(
|
||||||
renderCompTypeVar
|
renderCompTypeVar.identical(o.NULL_EXPR),
|
||||||
|
[renderCompTypeVar
|
||||||
.set(ViewConstructorVars.viewUtils.callMethod(
|
.set(ViewConstructorVars.viewUtils.callMethod(
|
||||||
'createRenderComponentType',
|
'createRenderComponentType',
|
||||||
[
|
[
|
||||||
o.literal(templateUrlInfo),
|
view.genConfig.genDebugInfo ? o.literal(templateUrlInfo) : o.literal(''),
|
||||||
o.literal(view.component.template.ngContentSelectors.length),
|
o.literal(view.component.template.ngContentSelectors.length),
|
||||||
ViewEncapsulationEnum.fromValue(view.component.template.encapsulation), view.styles,
|
ViewEncapsulationEnum.fromValue(view.component.template.encapsulation),
|
||||||
animationsExpr
|
view.styles,
|
||||||
|
animationsExpr,
|
||||||
]))
|
]))
|
||||||
.toStmt()
|
.toStmt()])];
|
||||||
])];
|
|
||||||
}
|
}
|
||||||
return o
|
return o
|
||||||
.fn(viewFactoryArgs, initRenderCompTypeStmts.concat([new o.ReturnStatement(
|
.fn(viewFactoryArgs, initRenderCompTypeStmts.concat([new o.ReturnStatement(
|
||||||
|
|
Loading…
Reference in New Issue