Skip to content

Commit 28c2391

Browse files
committed
Configure tsup
1 parent af6b586 commit 28c2391

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

.github/workflows/continuous-integration.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
- run: pnpm install
1515
- run: pnpm run test
1616
- run: pnpm run typecheck
17+
- run: pnpm run build
1718
# FIXME: To be reactivated
1819
# - run: pnpm run lint
1920
# - run: pnpm run smoke cjs 19.0.0

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"version": "17.0.0",
44
"description": "Turn a ReactElement into the corresponding JSX string.",
55
"packageManager": "[email protected]",
6-
"main": "dist/cjs/index.js",
7-
"module": "dist/esm/index.js",
8-
"browser": "dist/cjs/index.js",
9-
"types": "index.d.ts",
6+
"main": "dist/index.mjs",
7+
"module": "dist/index.mjs",
8+
"browser": "dist/index.js",
9+
"types": "dist/index.d.ts",
1010
"scripts": {
1111
"build": "tsup",
1212
"prebuild": "rm -rf dist/",

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"esModuleInterop": true,
1212
"noEmit": true
1313
},
14-
"include": ["src/"],
14+
"include": ["src/", "vitest.config.ts", "tsup.config.ts"],
1515
"exclude": ["node_modules/"]
1616
}

tsup.config.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from 'tsup';
2+
3+
export default defineConfig({
4+
entry: ['src/index.ts'],
5+
format: ['esm', 'cjs'],
6+
splitting: true,
7+
sourcemap: true,
8+
clean: true,
9+
dts: true,
10+
metafile: true,
11+
target: ['node20', 'es2015'],
12+
});

0 commit comments

Comments
 (0)