From 6164022e9ec09614ea0f23afe090cdb3a971b96f Mon Sep 17 00:00:00 2001 From: Victorien Elvinger Date: Thu, 1 Jun 2023 14:34:31 +0200 Subject: [PATCH] refactor: exports for types and package.json To ensure that `package.json` is qccessible, it has to be exported. See https://github.com/nodejs/node/issues/33460 For the same reason, we now export TypeScript types. --- package.json | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4328557c..b09a97a8 100644 --- a/package.json +++ b/package.json @@ -29,13 +29,19 @@ "bin": { "bare": "./dist/cli.js" }, - "types": "./dist/index.d.ts", - "main": "./dist/index.cjs", "module": "./dist/index.js", + "main": "./dist/index.cjs", "exports": { - "module": "./dist/index.js", - "require": "./dist/index.cjs", - "default": "./dist/index.js" + "./package.json": "./package.json", + ".": { + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + }, + "types": "./dist/index.d.ts", + "module": "./dist/index.js", + "default": "./dist/index.js" + } }, "sideEffects": false, "files": [