目前截至 2018 年 12 月,在 Angular cli 7.0.7 中,已添加了最小选项。这意味着Create a barebones project without any testing frameworks。
您可以查看angular cli version 7 document 以获取选项列表。
下面是 ng new --help 命令返回的选项列表。
ng new --help
arguments:
name
The name of the workspace.
options:
--collection (-c)
Schematics collection to use.
--commit
Initial repository commit information.
--create-application
Flag to toggle creation of an application in the new workspace.
--defaults
When true, disables interactive input prompts for options with a default.
--directory
The directory name to create the workspace in.
--dry-run (-d)
When true, run through and report activity without writing out results.
--experimental-ivy
EXPERIMENTAL: Specifies whether to create a new application which uses the Ivy rendering engine.
--force (-f)
When true, force overwriting of existing files.
--help
Shows a help message for this command in the console.
--inline-style (-s)
Specifies if the style will be in the ts file.
--inline-template (-t)
Specifies if the template will be in the ts file.
--interactive
When false, disables interactive input prompts.
--minimal
Create a barebones project without any testing frameworks
--new-project-root
The path where new projects will be created.
--prefix (-p)
The prefix to apply to generated selectors.
--routing
Generates a routing module.
--skip-git (-g)
Skip initializing a git repository.
--skip-install
Skip installing dependency packages.
--skip-tests (-S)
Skip creating spec files.
--style
The file extension to be used for style files.
--verbose (-v)
Adds more details to output logging.
--view-encapsulation
Specifies the view encapsulation strategy.
从 Angular cli 6.0.8 开始,最小选项似乎已被删除。您可能必须像其他答案建议的那样运行 --skip-tests、--inline-style 和 --inline-template 以获得最小的项目。
根据angular cli wiki page,这些是可用的选项
空运行
力
冗长的
收藏
内联样式
内联模板
视图封装
路由
前缀
风格
跳过测试
跳过包json
如果你运行这个命令:ng new --help,你可以看到 Angular cli 6.0.8 有哪些选项
usage: ng new <name> [options]
options:
--collection (-c)
Schematics collection to use.
--directory
The directory name to create the workspace in.
--dryRun (-d)
Run through without making any changes.
--force (-f)
Forces overwriting of files.
--inline-style (-s)
Specifies if the style will be in the ts file.
--inline-template (-t)
Specifies if the template will be in the ts file.
--new-project-root
The path where new projects will be created.
--prefix (-p)
The prefix to apply to generated selectors.
--routing
Generates a routing module.
--skip-git (-g)
Skip initializing a git repository.
--skip-install
Skip installing dependency packages.
--skip-tests (-S)
Skip creating spec files.
--style
The file extension to be used for style files.
--verbose (-v)
Adds more details to output logging.
--view-encapsulation
Specifies the view encapsulation strategy.