--minimal在angular-cli`ng new`中有什么作用? [英] What does --minimal do in angular-cli `ng new`?

查看:99
本文介绍了--minimal在angular-cli`ng new`中有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Angular CLI有一个名为--minimal的选项.它有什么作用,在哪里记录? ng help new命令对此几乎没有说明

The Angular CLI has an option called --minimal. What does it do and where is it documented? The command ng help new says very little about it

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

推荐答案

当前有效期至2017年7月31日.常规的角度应用程序会生成5个目录,26个文件. --minimal生成4 directories, 13 files.区别? --minimal通过启用其他一些选项来排除多个文件的生成.

Current as of July 31, 2017 A regular angular app generates 5 directories, 26 files. A --minimal generates 4 directories, 13 files. The difference? --minimal excludes generation of multiple files by enabling some other options.

  • 您可以在在此处输入代码
    • --skip-tests :停止生成包括tsconfig.spec.jsonapp.component.spec.ts
    • 的测试(即e2e,karma.conf.jsprotractor.conf.js*.spec.文件).
    • --inline-style :停止生成外部CSS存根,而在.ts文件中保留一个空字符串.
    • --inline-template :停止生成外部html,而是将其保留在.ts文件的template变量中.
    • You can see this in the code here
      • --skip-tests: stops the generation of testing (viz. e2e, karma.conf.js, protractor.conf.js, and *.spec. files) including tsconfig.spec.json, app.component.spec.ts
      • --inline-style: stops the generation of external css stubs instead keeping an empty string in the .ts file.
      • --inline-template: stops the generation of external html instead keeping it in the template variable in the .ts file.
      • README.md
      • tsconfig和tslint
      • favicon.ico

      这里是示例生成的,没有--minimal

      Here are the example's generated without --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
      

      这篇关于--minimal在angular-cli`ng new`中有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆