From 92c181eb03429815e8c1b82018750cf0b301b3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20M=C3=BCller?= Date: Sat, 27 Jul 2024 15:36:27 +0200 Subject: [PATCH] Add exports field to package.json See https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseESM.md for more detail --- package.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 49dff617..726ba461 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,20 @@ "repository": "git://github.com/ianstormtaylor/superstruct.git", "type": "module", "main": "./dist/index.cjs", - "module": "./dist/index.mjs", + "module": "./dist/index.js", "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, "sideEffects": false, "files": [ "dist"