Skip to content

Commit 9bd69f5

Browse files
committed
feat: switch to tsup build
1 parent 4b1adce commit 9bd69f5

File tree

5 files changed

+355
-475
lines changed

5 files changed

+355
-475
lines changed

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
"version": "8.26.1",
44
"description": "Monitor if a component is inside the viewport, using IntersectionObserver API",
55
"source": "./src/index.tsx",
6-
"main": "./dist/react-intersection-observer.js",
7-
"module": "./dist/react-intersection-observer.esm.js",
8-
"unpkg": "./dist/react-intersection-observer.umd.js",
6+
"main": "./dist/index.js",
7+
"module": "./dist/index.mjs",
98
"types": "./dist/index.d.ts",
109
"exports": {
1110
"./test-utils": {
@@ -14,8 +13,8 @@
1413
},
1514
".": {
1615
"types": "./dist/index.d.ts",
17-
"require": "./dist/react-intersection-observer.js",
18-
"default": "./dist/react-intersection-observer.modern.mjs"
16+
"require": "./dist/index.js",
17+
"default": "./dist/index.mjs"
1918
}
2019
},
2120
"author": "Daniel Schmidt",
@@ -28,12 +27,12 @@
2827
"scripts": {
2928
"prebuild": "rm -rf dist lib",
3029
"build": "run-s build:*",
31-
"build:bundle": "microbundle --name ReactIntersectionObserver --jsx React.createElement -f cjs,umd,es,modern --no-compress",
30+
"build:bundle": "tsup src/index.tsx",
3231
"build:utils": "tsc -p tsconfig.test.json",
3332
"build:copy": "node scripts/build-copy.js",
3433
"postbuild": "size-limit",
3534
"dev": "run-p dev:*",
36-
"dev:package": "microbundle --jsx React.createElement -f cjs,es,modern --no-compress --watch",
35+
"dev:package": "tsup src/index.tsx --watch",
3736
"dev:storybook": "pnpm --filter storybook dev",
3837
"lint": "eslint . --ext js,ts,tsx",
3938
"release": "np --contents dist",
@@ -100,19 +99,19 @@
10099
},
101100
"size-limit": [
102101
{
103-
"path": "dist/react-intersection-observer.esm.js",
102+
"path": "dist/index.mjs",
104103
"name": "InView",
105104
"import": "{ InView }",
106105
"limit": "1.8 kB"
107106
},
108107
{
109-
"path": "dist/react-intersection-observer.esm.js",
108+
"path": "dist/index.mjs",
110109
"name": "useInView",
111110
"import": "{ useInView }",
112111
"limit": "1.3 kB"
113112
},
114113
{
115-
"path": "dist/react-intersection-observer.esm.js",
114+
"path": "dist/index.mjs",
116115
"name": "observe",
117116
"import": "{ observe }",
118117
"limit": "1 kB"
@@ -144,6 +143,7 @@
144143
"react-dom": "^18.2.0",
145144
"simple-git-hooks": "^2.8.1",
146145
"size-limit": "^8.2.4",
146+
"tsup": "^6.7.0",
147147
"typescript": "^4.9.5",
148148
"vitest": "^0.31.3"
149149
},

0 commit comments

Comments
 (0)