File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 44 chain ,
55 schematic ,
66 SchematicContext ,
7+ TaskId ,
78} from '@angular-devkit/schematics' ;
89
910import { Schema as ApplicationOptions } from './application/schema' ;
@@ -28,9 +29,13 @@ export default function(options: NgNewOptions): Rule {
2829 }
2930 } ,
3031 ( _tree : Tree , context : SchematicContext ) => {
31- const packageTask = context . addTask ( new NodePackageInstallTask ( options . name ) ) ;
32+ const dependencies : Array < TaskId > = [ ] ;
33+
34+ if ( ! options . skipInstall ) {
35+ const packageInstallTask = context . addTask ( new NodePackageInstallTask ( options . name ) ) ;
36+ dependencies . push ( packageInstallTask ) ;
37+ }
3238
33- const dependencies = [ packageTask ] ;
3439 context . addTask ( new RepositoryInitializerTask ( options . name , { } ) , dependencies ) ;
3540 } ,
3641 ] ) ;
@@ -51,7 +56,6 @@ const parseToSharedOptions = (options: NgNewOptions): SharedOptions => {
5156const parseToApplicationOptions = ( options : NgNewOptions ) : ApplicationOptions => {
5257 return {
5358 name : options . name ,
54-
5559 prefix : options . prefix ,
5660 sourceDir : options . sourceDir || 'app' ,
5761 style : options . style ,
Original file line number Diff line number Diff line change @@ -35,4 +35,8 @@ export interface Schema {
3535 * Skip adding an example component.
3636 */
3737 skipAutoGeneratedComponent ?: boolean ;
38+ /**
39+ * When true, does not install packages for dependencies.
40+ */
41+ skipInstall ?: boolean ;
3842}
Original file line number Diff line number Diff line change 5252 "type" : " boolean" ,
5353 "description" : " Specifies whether a sample master detail should be generated." ,
5454 "default" : false
55+ },
56+ "skipInstall" : {
57+ "description" : " When true, does not install packages for dependencies." ,
58+ "type" : " boolean" ,
59+ "default" : false
5560 }
5661 },
5762 "required" : [
You can’t perform that action at this time.
0 commit comments