From 57da6c3dbc1e6adcde0dbc799e97c0510de3a435 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Mon, 20 Jun 2022 09:40:33 +0200 Subject: [PATCH] fix: add esm as fallback module --- package.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 36f3fa30..9e7bed87 100644 --- a/package.json +++ b/package.json @@ -4,16 +4,22 @@ "description": "Monitor if a component is inside the viewport, using IntersectionObserver API", "source": "./src/index.tsx", "main": "./dist/react-intersection-observer.js", - "module": "./dist/react-intersection-observer.mjs", + "module": "./dist/react-intersection-observer.esm.js", + "unpkg": "./dist/react-intersection-observer.umd.js", + "types": "./dist/index.d.ts", "exports": { - "./test-utils": "./test-utils.js", + "./test-utils": { + "default": "./dist/test-utils.js", + "types": "./dist/test-utils.d.ts" + }, ".": { - "require": "./react-intersection-observer.js", - "default": "./react-intersection-observer.modern.mjs" + "module": "./dist/react-intersection-observer.esm.js", + "require": "./dist/react-intersection-observer.js", + "default": "./dist/react-intersection-observer.modern.mjs", + "types": "./dist/index.d.ts" } }, - "unpkg": "./dist/react-intersection-observer.umd.js", - "typings": "./dist/index.d.ts", + "files": ["dist", "README.md", "LICENSE", "package.json"], "author": "Daniel Schmidt", "sideEffects": false, "repository": { @@ -51,7 +57,6 @@ "build": "run-s build:*", "build:bundle": "microbundle --name ReactIntersectionObserver --jsx React.createElement -f cjs,umd,es,modern --no-compress", "build:utils": "tsc -p tsconfig.test.json", - "build:copy": "node scripts/build-copy.js", "postbuild": "size-limit", "dev": "yarn run storybook", "lint": "eslint . --ext js,ts,tsx", @@ -73,12 +78,7 @@ "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", - [ - "@semantic-release/npm", - { - "pkgRoot": "dist" - } - ], + "@semantic-release/npm", "@semantic-release/github" ] }, @@ -96,19 +96,19 @@ }, "size-limit": [ { - "path": "dist/react-intersection-observer.mjs", + "path": "dist/react-intersection-observer.esm.js", "name": "InView", "import": "{ InView }", "limit": "1.8 kB" }, { - "path": "dist/react-intersection-observer.mjs", + "path": "dist/react-intersection-observer.esm.js", "name": "useInView", "import": "{ useInView }", "limit": "1.3 kB" }, { - "path": "dist/react-intersection-observer.mjs", + "path": "dist/react-intersection-observer.esm.js", "name": "observe", "import": "{ observe }", "limit": "1 kB"