File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,22 @@ if (!core.success) {
1515 process . exit ( 1 )
1616}
1717
18- const { outputs } = await Bun . build ( {
19- entrypoints : [ "src/index.ts" ] ,
18+ const react = await Bun . build ( {
19+ entrypoints : [ "src/react/index.ts" ] ,
20+ outdir : "dist/react" ,
21+ format : "esm" ,
22+ target : "browser" ,
23+ external : [ "react" , "react-dom" ] ,
2024 minify : true ,
25+ banner : '"use client";' ,
2126} )
2227
23- const output = outputs [ 0 ]
24- if ( ! output ) throw new Error ( "Build produced no output" )
28+ if ( ! react . success ) {
29+ for ( const log of react . logs ) console . error ( log )
30+ process . exit ( 1 )
31+ }
2532
26- const gzipped = Bun . gzipSync ( await output . arrayBuffer ( ) )
33+ const gzipped = Bun . gzipSync ( await Bun . file ( "dist/index.js" ) . arrayBuffer ( ) )
2734const sizeKB = `${ ( gzipped . length / 1024 ) . toFixed ( 1 ) } kB`
2835
2936const glob = new Bun . Glob ( "tests/*.spec.ts" )
Original file line number Diff line number Diff line change 2121 "./src" : " ./src/index.ts" ,
2222 "./react" : {
2323 "types" : " ./src/react/index.ts" ,
24- "default" : " ./src /react/index.ts "
24+ "default" : " ./dist /react/index.js "
2525 }
2626 },
2727 "typesVersions" : {
3131 },
3232 "files" : [" dist" , " src" ],
3333 "scripts" : {
34- "build" : " bun build.ts" ,
34+ "build" : " NODE_ENV=production bun build.ts" ,
3535 "test" : " playwright test" ,
3636 "lint" : " biome check src tests" ,
3737 "lint:fix" : " biome check --write src tests" ,
You can’t perform that action at this time.
0 commit comments