File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,15 @@ export default async function loadReactClientManifest(reactClientManifestFileNam
1010 // Thus, the __dirname of this code is where we can find the manifest file.
1111 const manifestPath = path . resolve ( __dirname , reactClientManifestFileName ) ;
1212 const loadedReactClientManifest = loadedReactClientManifests . get ( manifestPath ) ;
13- if ( ! loadedReactClientManifest ) {
14- // TODO: convert to async
15- try {
16- const manifest = JSON . parse ( await fs . readFile ( manifestPath , 'utf8' ) ) as ClientManifest ;
17- loadedReactClientManifests . set ( manifestPath , manifest ) ;
18- return manifest ;
19- } catch ( error ) {
20- throw new Error ( `Failed to load React client manifest from ${ manifestPath } : ${ error } ` ) ;
21- }
13+ if ( loadedReactClientManifest ) {
14+ return loadedReactClientManifest ;
2215 }
2316
24- return loadedReactClientManifest ;
17+ try {
18+ const manifest = JSON . parse ( await fs . readFile ( manifestPath , 'utf8' ) ) as ClientManifest ;
19+ loadedReactClientManifests . set ( manifestPath , manifest ) ;
20+ return manifest ;
21+ } catch ( error ) {
22+ throw new Error ( `Failed to load React client manifest from ${ manifestPath } : ${ error } ` ) ;
23+ }
2524}
You can’t perform that action at this time.
0 commit comments