From ca3b4261dde1172eec1cec5637d160c2dc377d4a Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Mon, 5 Dec 2022 03:43:09 -0600 Subject: [PATCH] feat: re-add cjs support --- legacy/package.json | 6 +++--- legacy/tsup.config.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy/package.json b/legacy/package.json index 97b9f06c..0341d095 100644 --- a/legacy/package.json +++ b/legacy/package.json @@ -5,13 +5,13 @@ "author": "Travis Fischer ", "repository": "transitive-bullshit/chatgpt-api", "license": "MIT", - "type": "module", "source": "./src/index.ts", "types": "./build/index.d.ts", + "main": "./build/index.js", "exports": { ".": { - "import": "./build/index.js", - "default": "./build/index.js", + "import": "./build/index.mjs", + "require": "./build/index.js", "types": "./build/index.d.ts" } }, diff --git a/legacy/tsup.config.ts b/legacy/tsup.config.ts index 5dedfd7c..4953fc3f 100644 --- a/legacy/tsup.config.ts +++ b/legacy/tsup.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ outDir: 'build', target: 'node14', platform: 'node', - format: ['esm'], + format: ['esm', 'cjs'], splitting: false, sourcemap: true, minify: true,