1
- import Generator from "yeoman-generator" ;
2
- import path from "path" ;
3
- import { IWebpackCLI } from "webpack-cli" ;
1
+ import type Generator from "yeoman-generator" ;
2
+ import { type IWebpackCLI } from "webpack-cli" ;
4
3
5
4
export type InitOptions = { template : string ; force ?: boolean } ;
6
5
export type LoaderOptions = { template : string } ;
@@ -20,32 +19,3 @@ export type CustomGeneratorOptions<T extends BaseCustomGeneratorOptions> =
20
19
cli : IWebpackCLI ;
21
20
options : T ;
22
21
} ;
23
-
24
- export class CustomGenerator <
25
- T extends BaseCustomGeneratorOptions = BaseCustomGeneratorOptions ,
26
- Z extends CustomGeneratorOptions < T > = CustomGeneratorOptions < T > ,
27
- > extends Generator < Z > {
28
- public cli : IWebpackCLI ;
29
- public template : string ;
30
- public dependencies : string [ ] ;
31
- public force : boolean ;
32
- public answers : Record < string , unknown > ;
33
- public generationPath : string ;
34
- public supportedTemplates : string [ ] ;
35
- public packageManager : string | undefined ;
36
-
37
- public constructor ( args : string | string [ ] , opts : Z ) {
38
- super ( args , opts ) ;
39
-
40
- this . cli = opts . cli ;
41
- this . dependencies = [ ] ;
42
- this . answers = { } ;
43
- this . supportedTemplates = [ ] ;
44
-
45
- const { options } = opts ;
46
-
47
- this . template = options . template ;
48
- this . force = typeof options . force !== "undefined" ? options . force : false ;
49
- this . generationPath = path . resolve ( process . cwd ( ) , options . generationPath ) ;
50
- }
51
- }
0 commit comments