Fix enquirer import

This commit is contained in:
the1812 2022-06-18 23:39:58 +08:00
parent 7aa71b5f15
commit 45d96178a8

View File

@ -1,9 +1,6 @@
import glob from 'glob'
import { buildByEntry } from './config'
declare module 'enquirer' {
export const AutoComplete: any
}
export const builders = Object.fromEntries(['component', 'plugin', 'doc'].map(type => {
const src = `./registry/lib/${type}s/`
return [type, async ({ buildAll = false } = {}) => {
@ -16,7 +13,8 @@ export const builders = Object.fromEntries(['component', 'plugin', 'doc'].map(ty
let entry: string
if (entries.length > 1) {
const { AutoComplete } = await import('enquirer')
const { default: AutoComplete } = await import('enquirer/lib/prompts/autocomplete')
console.log(AutoComplete)
const prompt = new AutoComplete({
name: 'path',
message: 'Select build target',