我是angular2的新手,我曾try 使用cli创建一个项目,但当我try 更改css时,我在angular cli中添加了它.json,我检测到这个文件没有创建...
Can I create manually or this file has been changed for another one?
谢谢
我是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.