要建立一個沒有規範文件的新項目:
ng new --skip-tests true projectname
然後,您可以刪除:
- /E2E
- test.ts
- protractor.conf.js
- karma.conf.js
,如果你不想皮棉:
您還可以將您的package.json降低到:
{
"name": "projectname",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build"
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.0.4",
"@angular/compiler-cli": "^4.0.0",
"@types/node": "~6.0.60",
"ts-node": "~2.0.0",
"typescript": "~2.2.0"
}
}
當生成新組件和服務時,您可以附加--spec false
以跳過測試文件生成。