Skip to content

Commit 5279706

Browse files
heiskrCopilot
andauthored
Switch manifest-json from statSync to async fs.stat (#60391)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8f11aa2 commit 5279706

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/frame/middleware/manifest-json.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { NextFunction, Request, Response } from 'express'
2-
import fs from 'fs'
2+
import fs from 'fs/promises'
33
import path from 'path'
44

55
import { defaultCacheControl } from './cache-control'
@@ -53,7 +53,7 @@ export default async function manifestJson(req: Request, res: Response, next: Ne
5353
}
5454
for (const icon of ICONS) {
5555
for (const sizes of path.basename(icon).match(/\d+x\d+/g) || []) {
56-
const stats = fs.statSync(icon)
56+
const stats = await fs.stat(icon)
5757
const split = icon.slice(1).split(path.sep)
5858
const hash = `${stats.size}`
5959
split.splice(2, 0, `cb-${hash}`)

0 commit comments

Comments
 (0)