From 73fe89bbb33ed780ad4d7ea361894800128a5d45 Mon Sep 17 00:00:00 2001 From: emma Date: Wed, 8 Nov 2023 16:21:31 -0500 Subject: [PATCH] type-check tsup config --- tsup.config.ts | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/tsup.config.ts b/tsup.config.ts index 7952aa4..f3c4132 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,23 +1,21 @@ -import { defineConfig } from 'tsup'; +import { Options, defineConfig } from "tsup"; -const sharedConfig = { +const sharedConfig: Partial = { dts: true, minify: true, shims: true, - splitting: false -} - + splitting: false, +}; -const nodeConfig = { +const nodeConfig: Options = { ...sharedConfig, clean: true, entry: ["src/index.ts", "src/cli.ts", "src/utils.ts", "src/node/index.ts"], platform: "node", format: ["esm", "cjs"], -} - +}; -const browserConfig = { +const browserConfig: Options = { ...sharedConfig, clean: false, entry: ["src/index.ts"], @@ -25,14 +23,13 @@ const browserConfig = { format: ["esm"], outExtension() { return { - js: `.all.js`, - } + js: ".all.js", + }; }, sourcemap: true, - noExternal: ["pako", "uuid-random", "base32-encode"] + noExternal: ["pako", "uuid-random", "base32-encode"], }; - export default defineConfig((options) => { if (options.define && options.define.browser) { return browserConfig;