From 247dff88165cc133b617ed4b46cdfbfc5d490c2a Mon Sep 17 00:00:00 2001 From: Edie Lemoine Date: Mon, 17 Jul 2023 15:57:46 +0200 Subject: [PATCH] fix: fix esm error in bin --- bin/index.js | 2 +- bin/index.mjs | 1 - package.json | 6 +++--- tsup.config.ts | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 bin/index.mjs diff --git a/bin/index.js b/bin/index.js index f1f2a3d..e984853 100644 --- a/bin/index.js +++ b/bin/index.js @@ -1 +1 @@ -require("../dist/bin.js"); +import("../dist/bin.js"); diff --git a/bin/index.mjs b/bin/index.mjs deleted file mode 100644 index 3d4f1a8..0000000 --- a/bin/index.mjs +++ /dev/null @@ -1 +0,0 @@ -import("../dist/bin.mjs"); diff --git a/package.json b/package.json index dedbf06..ff610fd 100644 --- a/package.json +++ b/package.json @@ -13,14 +13,14 @@ }, "license": "MIT", "author": "Edie Lemoine ", + "type": "module", "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js" + "import": "./dist/index.js" } }, "main": "./dist/index.js", - "module": "./dist/index.mjs", + "module": "./dist/index.js", "types": "./dist/index.d.ts", "bin": "./dist/bin.js", "files": [ diff --git a/tsup.config.ts b/tsup.config.ts index 3f25651..7fcf378 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -2,6 +2,6 @@ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["src/bin.ts", "src/index.ts"], - format: ["cjs", "esm"], + format: ["esm"], tsconfig: "tsconfig.build.json", });