0

Can anyone explain to me why Angular 15 doesn't automatically create the files: environment.ts I understand this changed from version 14 to 15 More I did not understand the reason for this change, forcing to create manually, a standard thing.

an explanation of my doubt, the solution I already have.

2 Answers2

1

I wanna add something to complement @Ninii's post: Since Angular CLI 15.1.x it is possible (very easy) to create the environments again:

ng g environments (or long version: ng generate environments) - Thats all. Read more about here: Angular CLI

The project's src/environments/ directory contains the base configuration file, environment.ts, which provides configuration for production, the default environment. You can override default values for additional environments, such as development and staging, in target-specific configuration files.

enter image description here

Flo
  • 2,232
  • 2
  • 11
  • 18
0

This post explains very well the why angular team chose to remove those files.

Angular uses a new way to tell main.ts that applicaiton is running in dev / prod mode, removing the need of having environment.ts in the first place as stated in the article

PasNinii
  • 634
  • 8
  • 18