$schema

JSON Schema is a tool that allows us to annotate and validate JSON data formats.

You can find this schema.json file in the node_module path of any Angular app created using the Angular CLI: C:\Code\SPA\sandbox\node_modules@angular\cli\lib\config\schema.json

For example, when we edit angular.json file, some fields such as cli.packageManager can appear autocomplete prompt:

Because all of these options are defined in the schema.json file:

Projecttype, for example, has only application and Library.

projects

The sandbox is the name of my app and the root of the Angular app.

schematics

Specify that the app uses SCSS style technology from the Component level:

architect

The meaning of ng serve can also be found in schema.json: Compile and serve the app.

Ng serve targets sandbox:build, using @angular-devkit/build-angular:dev-server:

So just to experiment, if I change browserTarget to sandbox:build2,

An error:

An unhandled exception occurred: Invalid target: {” project “, “sandbox”, “target” : “build2}”. See “C: \ Users \ I042416 \ AppData \ Local \ Temp \ ng – dOBpdq \ presents – errors. Log” for further details.

Unless you change your build in Architect to build2 as well:

Here is my index.html file at Design Time, without the script tag:

Localhost = ‘serve’; localhost = ‘serve’;

For more of Jerry’s original articles, please follow the public account “Wang Zixi “: