From 8688cf3c8e04a7f0c6e5b908e753be08b4f56042 Mon Sep 17 00:00:00 2001 From: EGOIST Date: Sun, 17 Apr 2022 14:46:02 +0800 Subject: [PATCH] fix: publish as esm module, fixes #26 --- package.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 519aa49e..508a6029 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,15 @@ "files": [ "dist" ], - "main": "./dist/index.js", "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "default": "./dist/index.js" + } + }, "scripts": { - "build": "tsup src/index.ts --format cjs --dts", + "build": "tsup src/index.ts --format cjs,esm --dts", "test": "npm run build && uvu -r esbuild-register --ignore fixtures", "prepublishOnly": "npm run build" },