File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,20 @@ export default function (options: ComponentOptions): Rule {
42
42
options . spec = false ;
43
43
}
44
44
45
+ if (
46
+ ! platformUse . nsOnly && // the project is shared
47
+ platformUse . useNs && ! platformUse . useWeb // the new component is only for {N}
48
+ ) {
49
+ options . skipImport = true ; // don't declare it in the web NgModule
50
+ }
51
+
45
52
validateGenerateOptions ( platformUse , options ) ;
46
53
validateGenerateComponentOptions ( platformUse , options ) ;
47
54
48
55
return tree ;
49
56
} ,
50
57
51
- ( ) => {
52
- return externalSchematic ( '@schematics/angular' , 'component' , removeNsSchemaOptions ( options ) ) ;
53
- } ,
58
+ ( ) => externalSchematic ( '@schematics/angular' , 'component' , removeNsSchemaOptions ( options ) ) ,
54
59
55
60
( tree : Tree ) => {
56
61
extensions = getExtensions ( tree , options ) ;
You can’t perform that action at this time.
0 commit comments