File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
packages/metro-serializer-esbuild/src Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @rnx-kit/metro-serializer-esbuild " : patch
3+ ---
4+
5+ Don't block when writing metafile
Original file line number Diff line number Diff line change @@ -323,13 +323,23 @@ export function MetroSerializer(
323323 esbuild
324324 . analyzeMetafile ( metafile , options )
325325 . then ( ( text ) => info ( text ) ) ;
326+ } else {
327+ info ( "esbuild bundle size:" , result . code . length ) ;
326328 }
329+
327330 if ( typeof buildOptions ?. metafile === "string" ) {
328- fs . writeFileSync (
329- path . join ( path . dirname ( sourcemapfile ) , buildOptions . metafile ) ,
330- typeof metafile === "string" ? metafile : JSON . stringify ( metafile )
331- ) ;
332- info ( "esbuild bundle size:" , result . code . length ) ;
331+ const outDir = path . dirname ( sourcemapfile ) ;
332+ const out = path . join ( outDir , buildOptions . metafile ) ;
333+
334+ info ( "Writing esbuild metafile to:" , out ) ;
335+
336+ const metadata =
337+ typeof metafile === "string"
338+ ? metafile
339+ : JSON . stringify ( metafile ) ;
340+ fs . writeFile ( out , metadata , ( ) => {
341+ info ( "Done writing esbuild metafile" ) ;
342+ } ) ;
333343 }
334344 } else {
335345 info ( "esbuild bundle size:" , result . code . length ) ;
You can’t perform that action at this time.
0 commit comments