From 14b666768c903cc2e32b6b377491b9ba0efbe757 Mon Sep 17 00:00:00 2001 From: sapphi-red Date: Tue, 12 Jul 2022 00:33:34 +0900 Subject: [PATCH] perf: exclude transpiled prompts code --- scripts/build.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/build.mjs b/scripts/build.mjs index b255ccd67..f832a89e2 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -33,6 +33,16 @@ await esbuild.build({ target: 'node14', plugins: [ + { + name: 'alias', + setup({ onResolve, resolve }) { + onResolve({ filter: /^prompts$/, namespace: 'file' }, async ({ importer, resolveDir }) => { + // we can always use non-transpiled code since we support 14.16.0+ + const result = await resolve('prompts/lib/index.js', { importer, resolveDir }) + return result + }) + } + }, esbuildPluginLicense({ thirdParty: { includePrivate: false,