angular default project ,angular.json的解读

Understanding it's purpose and limits

Follow

Nov 6, 2018

angular.json, to say which project should run with ng commands without a defined project.

large discussion about project layout for 8.x.x.

my-app:

$ ng new my-app

angular.json with the following structure:

{
...,
"projects": {
"my-app": { ... },
"my-app-e2e": { ... },
},
"defaultProject": "my-app",
}

ng serve my-app.

Setting a new default project

To understand what values are valid, let's create a library and an application.

$ ng create application my-application
$ ng create library my-library

Now, we have the following structure:

{
...,
"projects": {
"my-app": { ... },
"my-app-e2e": { ... },
"my-application": { ... },
"my-application-e2e": { ... },
"my-library": { ... }
},
"defaultProject": "my-app",
}

ng e2e.

my-application) will automatically be set as the default project.

Commands

test.


collection of tips for managing Angular workspaces.