From 45d96178a897c2a05801e1015827e4d1e5973a73 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 18 Jun 2022 23:39:58 +0800 Subject: [PATCH] Fix enquirer import --- registry/webpack/build.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/registry/webpack/build.ts b/registry/webpack/build.ts index 8a8a958ba..aab4ba439 100644 --- a/registry/webpack/build.ts +++ b/registry/webpack/build.ts @@ -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',