You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow adding to the default conditions instead of replacing them #34838
Setting conditions on @angular/build:application replaces the default ['module', 'development' | 'production'] (application-code-bundle.ts). This matches the option's documentation, but it means adding one condition also removes module and the development/production condition, and the replacement can't depend on the configuration's optimization setting without repeating the list in every configuration.
Packages such as @apollo/client select development or production code by condition. After adding a single custom condition, a production build no longer gets their production entry points, and a development build no longer gets their development ones.
Add a package whose exports have module, development and production conditions, and import it.
ng build resolves module and production.
Add "conditions": ["my-condition"] to the build target options and run ng build again. Neither module nor production is resolved.
Describe the solution you'd like
A way to add conditions while Angular keeps choosing module and development or production from the configuration. Potentially, a boolean such as keepDefaultConditions that keeps the defaults when conditions is set. It defaults to false, so existing projects keep today's behavior.
Describe alternatives you've considered
Repeating module and development or production in conditions for every configuration. This duplicates Angular's choice of development or production and goes stale if a configuration's optimization setting changes.
Activity