ng serve does not support the "define" argument #28905
Labels
area: @angular/build
devkit/build-angular:dev-server
feature: votes required
Feature request which is currently still in the voting phase
feature
Issue that requests a new feature
Command
serve
Description
I want to pass environment variables into the application during serve and build. In Angular 19, this works for build:
ng build --define="GGCC_TARGET='hosted'"
, while this doesn't for serve:ng serve --define="GGCC_TARGET='hosted'"
, with the following error:Describe the solution you'd like
The
--define
argument works for both serve and build commands.Describe alternatives you've considered
The custom "@ngx-env/builder:application" builder works, but I'd prefer to keep the amount of extra libraries to a minimum. Given how that builder is merely a thin wrapper around "@angular/build:application", I don't see why this couldn't work as I expect out of the box.
The text was updated successfully, but these errors were encountered: