新的@angular/cli 版本中的文件 angular-cli.json 在哪里? [英] Where is the file angular-cli.json in the new @angular/cli version?

查看:33
本文介绍了新的@angular/cli 版本中的文件 angular-cli.json 在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 angular2 的新手,我尝试使用 cli 创建一个项目,但是当我尝试更改 css 并将其添加到 angular-cli.json 中时,我检测到未创建此文件...

I'm new in angular2 and i have tried to create a project with cli, but when I try to change the css adding it in angular-cli.json, I have detected that this file is not created...

我可以手动创建还是此文件已更改为另一个?

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

谢谢!!

推荐答案

angular-cli.json 应该位于项目的根文件夹中.这是使用最新版本 "@angular/cli": "1.0.0-beta.32.3".

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".

至于创建它,如果它丢失或可能意外删除,您可以尝试,因为原始版本非常通用.下面是项目创建后的样子:

As for creating it if it is missing or maybe accidentally deleted, you could try that since the original version is pretty generic. Here is what it should look like right after project creation:

{
  "$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": {}
  }
}

您也可以尝试使用带有 ng new PROJECT_NAME 的 cli 生成一个新项目,看看它是否包含 angular-cli.json 文件.

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.

这篇关于新的@angular/cli 版本中的文件 angular-cli.json 在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆