From 963e7fffb7ead9b2581aa1b235b354e4031af25c 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 --- package.json | 6 +++--- tsup.config.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 97b9f06..0341d09 100644 --- a/package.json +++ b/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/tsup.config.ts b/tsup.config.ts index 5dedfd7..4953fc3 100644 --- a/tsup.config.ts +++ b/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,