Search code examples
javascriptangulartypescriptangular-cliangular-cli-v6

How to default dry run with angular cli


What: Is there any way to default dry-run in a configuration?

Why: This makes learning so much easier because we don't need to cleanup as many messes if the command wasn't quite right. This could force you to first try a dry run before explicitly generating.


Solution

  • I looked for a solution natively but couldn't find any answers. I ended up wrapping the ng g call in my package.json: "ngd": "ng g -d --"

    Examples:

    Provides a component, a module, etc. and accepts all parameters like normal

    npm run ngd c my/component/ npm run ngd m moduleName npm run ngd d directiveName