@@ -13,6 +13,7 @@ import type {
13
13
ListQuestion ,
14
14
Question ,
15
15
} from 'inquirer' ;
16
+ import { loadEsmModule } from './load-esm' ;
16
17
import { isTTY } from './tty' ;
17
18
18
19
export async function askConfirmation (
@@ -32,8 +33,8 @@ export async function askConfirmation(
32
33
default : defaultResponse ,
33
34
} ;
34
35
35
- const { prompt } = await import ( 'inquirer' ) ;
36
- const answers = await prompt ( [ question ] ) ;
36
+ const { default : inquirer } = await loadEsmModule < typeof import ( 'inquirer' ) > ( 'inquirer' ) ;
37
+ const answers = await inquirer . prompt ( [ question ] ) ;
37
38
38
39
return answers [ 'confirmation' ] ;
39
40
}
@@ -57,8 +58,8 @@ export async function askQuestion(
57
58
default : defaultResponseIndex ,
58
59
} ;
59
60
60
- const { prompt } = await import ( 'inquirer' ) ;
61
- const answers = await prompt ( [ question ] ) ;
61
+ const { default : inquirer } = await loadEsmModule < typeof import ( 'inquirer' ) > ( 'inquirer' ) ;
62
+ const answers = await inquirer . prompt ( [ question ] ) ;
62
63
63
64
return answers [ 'answer' ] ;
64
65
}
@@ -80,8 +81,8 @@ export async function askChoices(
80
81
choices,
81
82
} ;
82
83
83
- const { prompt } = await import ( 'inquirer' ) ;
84
- const answers = await prompt ( [ question ] ) ;
84
+ const { default : inquirer } = await loadEsmModule < typeof import ( 'inquirer' ) > ( 'inquirer' ) ;
85
+ const answers = await inquirer . prompt ( [ question ] ) ;
85
86
86
87
return answers [ 'answer' ] ;
87
88
}
0 commit comments