From d0e663c14d00b17e22a736db548f068c7016d7bb Mon Sep 17 00:00:00 2001 From: Alex / KATT Date: Fri, 13 Oct 2023 02:00:58 +0200 Subject: [PATCH] feat: add commonjs support (#60) --- package.json | 5 +++++ tsup.config.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c866bb21..b795554e 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,11 @@ "license": "MIT", "author": "KATT", "type": "module", + "exports": { + "import": "./lib/index.js", + "require": "./lib/index.cjs", + "default": "./lib/index.js" + }, "main": "./lib/index.js", "files": [ "lib/", diff --git a/tsup.config.ts b/tsup.config.ts index 43c6f24e..6624b1d4 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ clean: true, dts: true, entry: ["src/**/*.ts", "!src/**/*.test.*"], - format: "esm", + format: ["cjs", "esm"], outDir: "lib", sourcemap: true, });