Unverified Commit bfdf5278 authored by elitalpa's avatar elitalpa Committed by GitHub

fix: webpack build error on Windows (#71943)

parent ba9879bf
......@@ -76,8 +76,6 @@ async function getStaticAssetRouteCode(
resourcePath: string,
fileBaseName: string
) {
resourcePath = path.posix.normalize(resourcePath)
const cache =
fileBaseName === 'favicon'
? 'public, max-age=0, must-revalidate'
......@@ -107,7 +105,7 @@ const buffer = Buffer.from(${JSON.stringify(
if (${isTwitter || isOpenGraph}) {
const fileSizeInMB = buffer.byteLength / 1024 / 1024
if (fileSizeInMB > ${fileSizeLimit}) {
throw new Error('File size for ${imgName} image "${resourcePath}" exceeds ${fileSizeLimit}MB. ' +
throw new Error('File size for ${imgName} image ${JSON.stringify(resourcePath)} exceeds ${fileSizeLimit}MB. ' +
\`(Current: \${fileSizeInMB.toFixed(2)}MB)\n\` +
'Read more: https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image#image-files-jpg-png-gif'
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment