From bae2aeeff7784435d8e9dac46b959fe68907e767 Mon Sep 17 00:00:00 2001 From: jeffwcx Date: Thu, 27 Jun 2024 02:05:24 +0800 Subject: [PATCH] build: reduce the size of cjs by making inquirer deps as external #1 --- .changeset/fast-owls-camp.md | 5 +++++ tsup.config.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/fast-owls-camp.md diff --git a/.changeset/fast-owls-camp.md b/.changeset/fast-owls-camp.md new file mode 100644 index 0000000..21a806c --- /dev/null +++ b/.changeset/fast-owls-camp.md @@ -0,0 +1,5 @@ +--- +'inquirer-select-pro': patch +--- + +make @inquirer/core as external dep which can reduce the size of cjs diff --git a/tsup.config.ts b/tsup.config.ts index dfed238..898a1a4 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -14,7 +14,8 @@ export default defineConfig([ entry: ['src/index.ts'], format: ['cjs'], platform: 'node', - noExternal: [/(.*)/], + noExternal: [/^((?!(@inquirer\/core|@inquirer\/type)).)*$/], + external: ['@inquirer/core', '@inquirer/type'], dts: true, sourcemap: true, },