Skip to content

feat(generators): add --minimal flag #2799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/@ionic/cli-utils/src/lib/ionic-angular/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export async function generate(args: { env: IonicEnvironment; inputs: string[],
const commandOptions = {
module: false,
constants: false,
minimal: false,
};

if (args.options['module']) {
Expand All @@ -28,6 +29,10 @@ export async function generate(args: { env: IonicEnvironment; inputs: string[],
if (args.options['constants']) {
commandOptions.constants = true;
}

if (args.options['minimal']) {
commandOptions.minimal = true;
}

switch (type) {
case 'page':
Expand Down
7 changes: 7 additions & 0 deletions packages/ionic/src/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The given ${chalk.green('name')} is normalized into an appropriate naming conven
'page Login',
'page Detail --no-module',
'page About --constants',
'component special-button --minimal',
'pipe MyFilterPipe'
],
inputs: [
Expand All @@ -48,6 +49,12 @@ The given ${chalk.green('name')} is normalized into an appropriate naming conven
description: 'Generate a page constant file for lazy-loaded pages',
type: Boolean,
default: false
},
{
name: 'minimal',
description: 'Only generate what is necessary. No comments, no lifecycle hooks, no module, no spec, inline template.',
type: Boolean,
default: false
}
]
})
Expand Down