angular / angular-cli

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

CLI does not set aot:true in angular.json for the dev server #16335

Closed juristr closed 4 years ago

juristr commented 4 years ago

🐞 Bug report

Command (mark with an x)

Is this a regression?

No, it's not a regression since this is something new that is supposed to change with Ivy.

Description

After the ng update command I expect that my projects in the angular.json have the aot flag set to true, not just for the production configuration, but also for the dev server.

πŸ”¬ Minimal Reproduction

Using node v12.4.0 and using yarn as my package manager (it's configured globally s.t. also the ng update command picks it up properly).

Commands run:

$ git clone git@github.com:juristr/superforms-talk.git
$ cd superforms-talk
$ ng update @angular/core@next @angular/cli@next --force

The only change to the angular.json is the addition of the budgets section

image

🌍 Your Environment




Angular CLI: 9.0.0-rc.4
Node: 12.4.0
OS: darwin x64

Angular: 9.0.0-rc.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-rc.4
@angular-devkit/build-angular     0.900.0-rc.4
@angular-devkit/build-optimizer   0.900.0-rc.4
@angular-devkit/build-webpack     0.900.0-rc.4
@angular-devkit/core              9.0.0-rc.4
@angular-devkit/schematics        9.0.0-rc.4
@angular/cdk                      8.2.3
@angular/material                 8.2.3
@ngtools/webpack                  9.0.0-rc.4
@schematics/angular               9.0.0-rc.4
@schematics/update                0.900.0-rc.4
rxjs                              6.5.3
typescript                        3.6.4
webpack                           4.41.2
alan-agius4 commented 4 years ago

When updating to a release version it is recommended to use the --next flag.

ng update @angular/core @angular/cli --next

This is because there are a couple of differences between @next and --next.

The main being that that @next will only use the next npm tag of the package provided. While --next will use also update to the latest prerelease version of the CLI to perform the update and peerDependencies matching will include pre-release versions, which otherwise you'd need to use the --force to suppress the warnings and continue with the update.

Note: The aot option should not be added under dev-server but rather under build -> options, because the builder builder options will be used unless overridden in the dev-server options.

juristr commented 4 years ago

Awesome, make sense. Thx for debugging πŸ‘

angular-automatic-lock-bot[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.