Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does --minimal do in angular-cli `ng new`?

Tags:

angular-cli

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 
like image 516
NO WAR WITH RUSSIA Avatar asked Aug 01 '17 04:08

NO WAR WITH RUSSIA


People also ask

What do you get after running the NG new skills command?

Syntax. ng new command creates a workspace of given name with a default Angular Application. It provides interactive prompts to set optional configurations. All prompts have default values to choose.

What is the syntax to create new Angular app?

Use Angular CLI command ng serve -o to build an application. The -o indicates to open it automatically in the default browser. Use NPM command npm start to build an application.

How many new files are created and updated when you create a new component using CLI?

CLI Component Generation It looks like the CLI automatically created the new folder to hold our new component in app/virtual-machines . In addition we see four new files associated with the automatically generated component.


1 Answers

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.

  • 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.
  • Stops the generation of the following files, code here
    • README.md
    • tsconfig and tslint
    • favicon.ico

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 does the following

├── 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 
like image 196
NO WAR WITH RUSSIA Avatar answered Sep 24 '22 18:09

NO WAR WITH RUSSIA