我是angular2的新手,我曾try 使用cli创建一个项目,但当我try 更改css时,我在angular cli中添加了它.json,我检测到这个文件没有创建...

Can I create manually or this file has been changed for another one?

谢谢

推荐答案

The angular-cli.json should be located in the root folder of the project. This is using the latest version "@angular/cli": "1.0.0-beta.32.3".

至于创建它,如果它丢失或可能被意外删除,你可以try ,因为原始版本是非常通用的.以下是项目创建后的外观:

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "version": "1.0.0-beta.32.3",
    "name": "testproj"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.json",
      "prefix": "app",
      "styles": [
        "styles.css"
      ],
      "scripts": [],
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "lint": [
    {
      "files": "src/**/*.ts",
      "project": "src/tsconfig.json"
    },
    {
      "files": "e2e/**/*.ts",
      "project": "e2e/tsconfig.json"
    }
  ],
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "css",
    "component": {}
  }
}

You could also try generating a new project with the cli with ng new PROJECT_NAME and see if it contains the angular-cli.json file.

Json相关问答推荐

从JSON格式提取数据时分隔通用名称

在Jenkins中使用ReadJSON读取json子元素

集成wix.comstore API|变音符号问题

JQ:获取该值的较短语法是什么

如何使用PowerShell从ExchangeOnline命令执行中获得JSON输出

将 REST API - json 输出转换为表 Power BI

go 语言中的 JSON 到 XML

取消嵌套数组并将数组名称添加为附加字段

如何在JQ中展平多维数组

在这种情况下我如何实现 UnmarshalJSON 并且只为一个接口字段定义特殊行为?

如何使用 jq 在连续的 json 记录流上调用操作

使用 serde 和 csv crates 将嵌套的 json 对象序列化为 csv

shell解析json并循环输出组合变量

如何使用 LINQ 在 C# 中重构对象?

如何使用 CORS 实现 JavaScript Google Places API 请求

Spring restTemplate 获取原始 json 字符串

POST:在 url 本身中发送 post 请求

Django:TypeError:[] 不是 JSON 可序列化的为什么?

有没有办法折叠 Postman 中的所有 json 字段

在播放框架 JsObject 中解析 Json 数组