@@ -13,6 +13,7 @@ import type {
1313 ListQuestion ,
1414 Question ,
1515} from 'inquirer' ;
16+ import { loadEsmModule } from './load-esm' ;
1617import { isTTY } from './tty' ;
1718
1819export async function askConfirmation (
@@ -32,8 +33,8 @@ export async function askConfirmation(
3233 default : defaultResponse ,
3334 } ;
3435
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 ] ) ;
3738
3839 return answers [ 'confirmation' ] ;
3940}
@@ -57,8 +58,8 @@ export async function askQuestion(
5758 default : defaultResponseIndex ,
5859 } ;
5960
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 ] ) ;
6263
6364 return answers [ 'answer' ] ;
6465}
@@ -80,8 +81,8 @@ export async function askChoices(
8081 choices,
8182 } ;
8283
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 ] ) ;
8586
8687 return answers [ 'answer' ] ;
8788}
0 commit comments