angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.76k stars 11.98k forks source link

Tree sharking config in template *.html files #28637

Closed xkx-dev closed 3 hours ago

xkx-dev commented 4 hours ago

Command

build

Description

As the angular has already support the built-in control workflow in template.

like

@if( __ENV_PROD__){
   < PROD-COMP>
} @else {
  <some -comp>
}

how to config some global vialiables __ENV_PROD__ to enable the tree sharking in both ts and html files ?

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

alan-agius4 commented 3 hours ago

Tree-shaking cannot be applied to code within the templates.