gpt4 book ai didi

angular-cli - --minimal 在 angular-cli `ng new` 中有什么作用?

转载 作者:行者123 更新时间:2023-12-03 11:35:50 24 4
gpt4 key购买 nike

Angular CLI 有一个名为 --minimal 的选项.它有什么作用,它在哪里记录?命令 ng help new很少谈论它

--minimal (Boolean) (Default: false) Should create a minimal app.
aliases: --minimal

最佳答案

当前截至 2017 年 7 月 31 日 一个普通的 Angular 应用会生成 5 个目录、26 个文件。一个 --minimal生成 4 directories, 13 files .区别? --minimal通过启用其他一些选项来排除生成多个文件。

  • 您可以在 code here 中看到这一点
  • --skip-tests :停止生成测试(即 e2e、karma.conf.jsprotractor.conf.js*.spec. 文件),包括 tsconfig.spec.json , app.component.spec.ts
  • --inline-style : 停止生成外部 css stub ,而是在 .ts 中保留一个空字符串文件。
  • --inline-template : 停止生成外部 html,而是将其保留在 template.ts 中的变量文件。
  • 停止生成以下文件,code here
  • README.md
  • tsconfig 和 tslint
  • favicon.ico

  • 以下是没有 --minimal 生成的示例
    my-app/
    ├── e2e
    │   ├── app.e2e-spec.ts
    │   ├── app.po.ts
    │   └── tsconfig.e2e.json
    ├── karma.conf.js
    ├── package.json
    ├── package-lock.json
    ├── protractor.conf.js
    ├── README.md
    ├── src
    │   ├── app
    │   │   ├── app.component.css
    │   │   ├── app.component.html
    │   │   ├── app.component.spec.ts
    │   │   ├── app.component.ts
    │   │   └── app.module.ts
    │   ├── assets
    │   ├── environments
    │   │   ├── environment.prod.ts
    │   │   └── environment.ts
    │   ├── favicon.ico
    │   ├── index.html
    │   ├── main.ts
    │   ├── polyfills.ts
    │   ├── styles.css
    │   ├── test.ts
    │   ├── tsconfig.app.json
    │   ├── tsconfig.spec.json
    │   └── typings.d.ts
    ├── tsconfig.json
    └── tslint.json
    --minimal执行以下操作
    ├── package.json
    ├── package-lock.json
    ├── src
    │   ├── app
    │   │   ├── app.component.ts
    │   │   └── app.module.ts
    │   ├── assets
    │   ├── environments
    │   │   ├── environment.prod.ts
    │   │   └── environment.ts
    │   ├── index.html
    │   ├── main.ts
    │   ├── polyfills.ts
    │   ├── styles.css
    │   ├── tsconfig.app.json
    │   └── typings.d.ts
    └── tsconfig.json

    关于angular-cli - --minimal 在 angular-cli `ng new` 中有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45429245/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com