美文网首页我爱编程
Angular 5.x 学习笔记(7)——Angular 5.X

Angular 5.x 学习笔记(7)——Angular 5.X

作者: 全栈开发之道 | 来源:发表于2018-03-28 16:07 被阅读0次

    在 Angular 2.X 后,通过 Angular CLI 所创建的工程,其结构复杂了起来,这正是框架的作用所在。

    Angular 工程有两个极为重要的配置文件: angular-cli.json 和 package.json

    (1) angular-cli.json , 配置文件如下:

    {
      "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
      "project": {
        "name": "getting-started-ng5"
      },
      "apps": [
        {
          "root": "src",
          "outDir": "dist",
          "assets": [
            "assets",
            "favicon.ico"
          ],
          "index": "index.html",
          "main": "main.ts",
          "polyfills": "polyfills.ts",
          "test": "test.ts",
          "tsconfig": "tsconfig.app.json",
          "testTsconfig": "tsconfig.spec.json",
          "prefix": "app",
          "styles": [
            "styles.scss"
          ],
          "scripts": [],
          "environmentSource": "environments/environment.ts",
          "environments": {
            "dev": "environments/environment.ts",
            "prod": "environments/environment.prod.ts"
          }
        }
      ],
      "e2e": {
        "protractor": {
          "config": "./protractor.conf.js"
        }
      },
      "lint": [
        {
          "project": "src/tsconfig.app.json",
          "exclude": "**/node_modules/**"
        },
        {
          "project": "src/tsconfig.spec.json",
          "exclude": "**/node_modules/**"
        },
        {
          "project": "e2e/tsconfig.e2e.json",
          "exclude": "**/node_modules/**"
        }
      ],
      "test": {
        "karma": {
          "config": "./karma.conf.js"
        }
      },
      "defaults": {
        "styleExt": "scss",
        "component": {}
      }
    }
    

    这个文件中,标注了整个APP的入口: index, main
    还有默认的配置: prefix (自动填写的前缀),比如 app-root 中的app,就是在这里定义的。

    相关文章

      网友评论

        本文标题:Angular 5.x 学习笔记(7)——Angular 5.X

        本文链接:https://www.haomeiwen.com/subject/bufucftx.html