Angular 开源项目启动器教程

Angular 开源项目启动器教程

angular-open-source-starterThis is a starter project for creating open-source libraries for Angular. It is a full fledged Angular workspace with demo application and easy library addition. It is designed to be used for open-sourcing libraries on Github and has everything you'd need ready for CI, code coverage, SSR testing, StackBlitz demo deployment and more.项目地址:https://gitcode.com/gh_mirrors/an/angular-open-source-starter

1. 项目的目录结构及介绍

angular-open-source-starter/
├── apps/
│   └── demo/
├── libs/
├── tools/
├── README.md
├── nx.json
├── package.json
├── tsconfig.base.json
└── ...
  • apps/: 包含示例应用程序的目录。
  • libs/: 用于存放自定义库的目录。
  • tools/: 包含项目工具和脚本的目录。
  • README.md: 项目的主要介绍文档。
  • nx.json: Nx 工作区的配置文件。
  • package.json: 项目的依赖和脚本配置文件。
  • tsconfig.base.json: TypeScript 的基础配置文件。

2. 项目的启动文件介绍

启动文件

  • package.json: 包含项目的启动脚本,例如 npm startnpm run serve

示例

{
  "scripts": {
    "start": "nx serve demo",
    "build": "nx build demo",
    "test": "nx test"
  }
}

3. 项目的配置文件介绍

nx.json

nx.json 文件是 Nx 工作区的配置文件,定义了项目结构、生成器和其他 Nx 相关的配置。

{
  "npmScope": "angular-open-source-starter",
  "affected": {
    "defaultBase": "main"
  },
  "tasksRunnerOptions": {
    "default": {
      "runner": "@nrwl/workspace/tasks-runners/default",
      "options": {
        "cacheableOperations": ["build", "lint", "test", "e2e"]
      }
    }
  },
  "projects": {
    "demo": {
      "tags": []
    },
    "demo-e2e": {
      "tags": [],
      "implicitDependencies": ["demo"]
    }
  }
}

tsconfig.base.json

tsconfig.base.json 文件是 TypeScript 的基础配置文件,定义了编译选项和路径映射。

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "module": "esnext",
    "lib": ["es2018", "dom"],
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "types": ["jest", "node"]
  },
  "exclude": ["node_modules", "tmp"]
}

通过以上配置文件和目录结构的介绍,您可以更好地理解和使用 angular-open-source-starter 项目。

angular-open-source-starterThis is a starter project for creating open-source libraries for Angular. It is a full fledged Angular workspace with demo application and easy library addition. It is designed to be used for open-sourcing libraries on Github and has everything you'd need ready for CI, code coverage, SSR testing, StackBlitz demo deployment and more.项目地址:https://gitcode.com/gh_mirrors/an/angular-open-source-starter

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

窦恺墩

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值