1
1
import chalk from "chalk" ;
2
2
import * as logSymbols from "log-symbols" ;
3
3
import * as Generator from "yeoman-generator" ;
4
- import * as Inquirer from "inquirer" ;
5
4
import * as path from "path" ;
6
5
7
6
import { getPackageManager } from "@webpack-cli/utils/package-manager" ;
@@ -142,23 +141,24 @@ export default class InitGenerator extends Generator {
142
141
`Alternatively, run "webpack(-cli) --help" for usage info\n\n` ,
143
142
) ;
144
143
145
- const { multiEntries } : { multiEntries : boolean } = await this . prompt ( [
144
+ const { multiEntries } = await this . prompt ( [
146
145
Confirm (
147
146
"multiEntries" ,
148
147
"Will your application have multiple bundles?" ,
149
148
false
150
149
) ,
151
150
] ) ;
152
151
153
- const entryOption : string | object = await entryQuestions ( self , multiEntries ) ;
152
+ // TODO string | object
153
+ const entryOption : void | { } = await entryQuestions ( self , multiEntries ) ;
154
154
155
155
if ( typeof entryOption === "string" && entryOption . length > 0 ) {
156
156
this . configuration . config . webpackOptions . entry = `${ entryOption } ` ;
157
157
} else if ( typeof entryOption === "object" ) {
158
158
this . configuration . config . webpackOptions . entry = entryOption ;
159
159
}
160
160
161
- const { outputDir } : { outputDir : string } = await this . prompt ( [
161
+ const { outputDir } = await this . prompt ( [
162
162
Input (
163
163
"outputDir" ,
164
164
"In which folder do you want to store your generated bundles?" ,
@@ -186,7 +186,7 @@ export default class InitGenerator extends Generator {
186
186
`path.resolve(__dirname, '${ outputDir } ')` ;
187
187
}
188
188
189
- const { langType } : { langType : string } = await this . prompt ( [
189
+ const { langType } = await this . prompt ( [
190
190
List ( "langType" , "Will you use one of the below JS solutions?" , [
191
191
LangType . ES6 ,
192
192
LangType . Typescript ,
@@ -197,7 +197,7 @@ export default class InitGenerator extends Generator {
197
197
langQuestionHandler ( this , langType ) ;
198
198
this . langType = langType ;
199
199
200
- const { stylingType } : { stylingType : string } = await this . prompt ( [
200
+ const { stylingType } = await this . prompt ( [
201
201
List ( "stylingType" , "Will you use one of the below CSS solutions?" , [
202
202
"No" ,
203
203
StylingType . CSS ,
@@ -211,7 +211,7 @@ export default class InitGenerator extends Generator {
211
211
212
212
if ( this . isProd ) {
213
213
// Ask if the user wants to use extractPlugin
214
- const { useExtractPlugin } : { useExtractPlugin : string } = await this . prompt ( [
214
+ const { useExtractPlugin } = await this . prompt ( [
215
215
Input (
216
216
"useExtractPlugin" ,
217
217
"If you want to bundle your CSS files, what will you name the bundle? (press enter to skip)" ,
@@ -294,7 +294,8 @@ export default class InitGenerator extends Generator {
294
294
// Generate README
295
295
this . fs . copyTpl (
296
296
path . resolve ( __dirname , "./templates/README.md" ) ,
297
- this . destinationPath ( "README.md" )
297
+ this . destinationPath ( "README.md" ) ,
298
+ { }
298
299
) ;
299
300
300
301
// Genrate tsconfig
0 commit comments