Skip to content

Commit a296737

Browse files
authored
Merge pull request #634 from thebuilder/fix/legacy-module
2 parents ff7289f + b24d9b2 commit a296737

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Monitor if a component is inside the viewport, using IntersectionObserver API",
55
"source": "./src/index.tsx",
66
"main": "./dist/index.js",
7-
"module": "./dist/index.mjs",
7+
"module": "./dist/esm/index.js",
88
"types": "./dist/index.d.ts",
99
"exports": {
1010
"./test-utils": {
@@ -28,6 +28,7 @@
2828
"prebuild": "rm -rf dist lib",
2929
"build": "run-s build:*",
3030
"build:bundle": "tsup src/index.tsx",
31+
"build:legacy": "tsup src/index.tsx --format esm --legacy-output --no-clean --no-dts --target es2020",
3132
"build:utils": "tsc -p tsconfig.test.json",
3233
"build:copy": "node scripts/build-copy.js",
3334
"postbuild": "size-limit",

tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig({
55
sourcemap: true,
66
dts: true,
77
clean: true,
8-
target: 'es2020',
8+
target: 'esnext',
99
external: ['react'],
1010
format: ['esm', 'cjs'],
1111
});

0 commit comments

Comments
 (0)