Skip to content

Commit 57da6c3

Browse files
committed
fix: add esm as fallback module
1 parent e59d9c2 commit 57da6c3

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@
44
"description": "Monitor if a component is inside the viewport, using IntersectionObserver API",
55
"source": "./src/index.tsx",
66
"main": "./dist/react-intersection-observer.js",
7-
"module": "./dist/react-intersection-observer.mjs",
7+
"module": "./dist/react-intersection-observer.esm.js",
8+
"unpkg": "./dist/react-intersection-observer.umd.js",
9+
"types": "./dist/index.d.ts",
810
"exports": {
9-
"./test-utils": "./test-utils.js",
11+
"./test-utils": {
12+
"default": "./dist/test-utils.js",
13+
"types": "./dist/test-utils.d.ts"
14+
},
1015
".": {
11-
"require": "./react-intersection-observer.js",
12-
"default": "./react-intersection-observer.modern.mjs"
16+
"module": "./dist/react-intersection-observer.esm.js",
17+
"require": "./dist/react-intersection-observer.js",
18+
"default": "./dist/react-intersection-observer.modern.mjs",
19+
"types": "./dist/index.d.ts"
1320
}
1421
},
15-
"unpkg": "./dist/react-intersection-observer.umd.js",
16-
"typings": "./dist/index.d.ts",
22+
"files": ["dist", "README.md", "LICENSE", "package.json"],
1723
"author": "Daniel Schmidt",
1824
"sideEffects": false,
1925
"repository": {
@@ -51,7 +57,6 @@
5157
"build": "run-s build:*",
5258
"build:bundle": "microbundle --name ReactIntersectionObserver --jsx React.createElement -f cjs,umd,es,modern --no-compress",
5359
"build:utils": "tsc -p tsconfig.test.json",
54-
"build:copy": "node scripts/build-copy.js",
5560
"postbuild": "size-limit",
5661
"dev": "yarn run storybook",
5762
"lint": "eslint . --ext js,ts,tsx",
@@ -73,12 +78,7 @@
7378
"plugins": [
7479
"@semantic-release/commit-analyzer",
7580
"@semantic-release/release-notes-generator",
76-
[
77-
"@semantic-release/npm",
78-
{
79-
"pkgRoot": "dist"
80-
}
81-
],
81+
"@semantic-release/npm",
8282
"@semantic-release/github"
8383
]
8484
},
@@ -96,19 +96,19 @@
9696
},
9797
"size-limit": [
9898
{
99-
"path": "dist/react-intersection-observer.mjs",
99+
"path": "dist/react-intersection-observer.esm.js",
100100
"name": "InView",
101101
"import": "{ InView }",
102102
"limit": "1.8 kB"
103103
},
104104
{
105-
"path": "dist/react-intersection-observer.mjs",
105+
"path": "dist/react-intersection-observer.esm.js",
106106
"name": "useInView",
107107
"import": "{ useInView }",
108108
"limit": "1.3 kB"
109109
},
110110
{
111-
"path": "dist/react-intersection-observer.mjs",
111+
"path": "dist/react-intersection-observer.esm.js",
112112
"name": "observe",
113113
"import": "{ observe }",
114114
"limit": "1 kB"

0 commit comments

Comments
 (0)