Skip to content

Commit 5f72580

Browse files
committed
feat: update tsdown config
1 parent ff03e3d commit 5f72580

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
},
3333
"scripts": {
3434
"build": "tsdown",
35+
"build:prod": "NODE_ENV=prod tsdown",
3536
"dev": "tsdown --watch",
3637
"lint": "eslint .",
3738
"playground": "vite --config playground/vite.config.ts",

tsdown.config.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import { defineConfig } from 'tsdown'
1+
import { defineConfig } from 'tsdown';
22

33
export default defineConfig([
44
{
55
entry: ['./src/index.ts'],
6-
platform: 'neutral',
6+
external: ['react', 'react/jsx-runtime'],
7+
platform: 'browser',
78
dts: true,
8-
},
9-
])
9+
minify: process.env.NODE_ENV === 'prod',
10+
sourcemap: true
11+
}
12+
]);

0 commit comments

Comments
 (0)