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
The documentation states that multiple configurations can be provided using a comma-separated list, like so: --configuration=state,fr, and that the last one will take precedence.
This behavior works perfectly fine when using ng build --configuration=foo,bar but the implementation breaks down with ng serve. Since the serve command uses browserTarget to select a build configuration, a configuration setup that works for the build command cannot be tested using the serve command.
Running ng build --configuration=production,noaot will correctly disable the aot compiler while keeping the other production settings.
Running ng serve --configuration=production,noaot will cause the build to use ONLY the noaot settings since they all end up bundled under the browserTarget key.
🔥 Exception or Error
This behavior renders the multi-configuration support pretty much useless as it forces developers to choose between using ng serve or using this feature.
While some properties can be directly overrided in the serve schema, not all can be customized. For instance, budgets and file replacements cannot be changed by the serve configuration, which makes it impossible to do something like this:
ng serve --configuration=qa,optimized
Where qa would only provide file replacements and optimized would turn on aot, turn off source maps, etc.
This is an issue for my team since we manage a project with 16 different environments that could be expressed with only 7 configurations if we could use ng serve together with comma-separated configurations.
🐞 bug report
Affected Package
The is an issue in package @angular/cli. Specifically related to this entry in the documentation: https://angular.io/guide/workspace-config#alternate-build-configurations
Description
The documentation states that multiple configurations can be provided using a comma-separated list, like so:
--configuration=state,fr
, and that the last one will take precedence.This behavior works perfectly fine when using
ng build --configuration=foo,bar
but the implementation breaks down withng serve
. Since the serve command usesbrowserTarget
to select a build configuration, a configuration setup that works for the build command cannot be tested using the serve command.🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-ivy-6kdefg?file=angular.json
Running
ng build --configuration=production,noaot
will correctly disable the aot compiler while keeping the other production settings.Running
ng serve --configuration=production,noaot
will cause the build to use ONLY the noaot settings since they all end up bundled under thebrowserTarget
key.🔥 Exception or Error
This behavior renders the multi-configuration support pretty much useless as it forces developers to choose between using
ng serve
or using this feature.While some properties can be directly overrided in the
serve
schema, not all can be customized. For instance, budgets and file replacements cannot be changed by theserve
configuration, which makes it impossible to do something like this:ng serve --configuration=qa,optimized
Where
qa
would only provide file replacements andoptimized
would turn on aot, turn off source maps, etc.This is an issue for my team since we manage a project with 16 different environments that could be expressed with only 7 configurations if we could use
ng serve
together with comma-separated configurations.🌍 Your Environment
Angular Version:
The text was updated successfully, but these errors were encountered: