From 048c4eaee5dd2b9d3b0d63a2c86cb5145ec81349 Mon Sep 17 00:00:00 2001 From: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Date: Sun, 16 Jan 2022 17:56:44 +0100 Subject: [PATCH] fix: fix incorrect CJS / ESM distribution (#17) --- package.json | 8 ++++---- src/index.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 76bbab4..f4c4dbe 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "version": "1.1.0", "author": "Greg Bergé ", "license": "MIT", - "main": "dist/index.js", - "module": "dist/react-merge-refs.esm.js", - "typings": "dist/index.d.ts", + "main": "./dist/index.js", + "exports": "./dist/index.js", + "typings": "./dist/index.d.ts", "repository": "github:gregberge/react-merge-refs", "funding": { "type": "github", @@ -22,7 +22,7 @@ "release": "standard-version && conventional-github-releaser --preset angular", "start": "tsdx watch", "test": "tsdx test", - "build": "tsdx build" + "build": "tsdx build --format cjs" }, "devDependencies": { "@testing-library/react": "^11.2.5", diff --git a/src/index.tsx b/src/index.tsx index 8253c30..7c745a1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,4 +1,4 @@ -import * as React from "react"; +import type * as React from "react"; export default function mergeRefs( refs: Array | React.LegacyRef>