- Hands-On Full Stack Web Development with Angular 6 and Laravel 5
- Fernando Monteiro
- 322字
- 2021-07-23 19:18:54
Dotfiles – .editorconfig, .gitignore, and .angular-cli.json
Dotfiles are the configuration files that start with a dot; they are always in the background of the project, but they are very important. They are used to customize your system. The name dotfiles is derived from the configuration files in Unix-like systems. In an Angular project, we will see three of these files:
- .editorconfig: This file configures the text editor to use a particular style of code, so that the project is consistent, even though it is being edited by several people and in several types of text editors.
- .gitignore: As the name suggests, it ignores determined folders and files, so that they are not tracked by source control. We often find node_modules and a dist folder that do not require version control, because they are generated every time we install the application or run build commands.
- .angular-cli.json: Stores the project settings and is constantly used when executing build or server commands. There can be several Angular applications in a single project. Let's look at some details and inspect .angular-cli.json:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "chapter03"
},
// Here we determinate the projects, for this example we have only one app.
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
// Configuration for both environment, developing and production
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
// Configuration for end to end tests and unit tests
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
// Stylesheet configiration, for this example we are using CSS
"defaults": {
"styleExt": "css",
"component": {}
}
}
推薦閱讀
- Hands-On Industrial Internet of Things
- 社交電商運營策略、技巧與實操
- 計算機網絡安全實訓教程(第二版)
- Go Web Scraping Quick Start Guide
- 局域網組建、管理與維護項目教程(Windows Server 2003)
- Socket.IO Real-time Web Application Development
- 物聯網與無線傳感器網絡
- 中國互聯網發展報告2018
- 5G技術與標準
- 物聯網頂層設計與關鍵技術
- 一本書讀懂TCP/IP
- 算力網絡:云網融合2.0時代的網絡架構與關鍵技術
- Building Microservices with Spring
- 通信系統實戰筆記:無處不在的信號處理
- ReasonML Quick Start Guide