2017-02-22 43 views

回答

14

angular-cli.json應位於項目的根文件夾。這是使用最新版本"@angular/cli": "1.0.0-beta.32.3"

作爲創建它,如果它丟失或可能不小心刪除了,你可以試試,因爲原始版本是非常通用的。下面是它看起來應該像什麼合適的項目創建後:

{ 
    "$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文件。

30

文件變更爲現在一個隱藏的文件在Unix/Linux系統。現在是.angular-cli.json

相關問題