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( ...@@ -76,8 +76,6 @@ async function getStaticAssetRouteCode(
resourcePath: string, resourcePath: string,
fileBaseName: string fileBaseName: string
) { ) {
resourcePath = path.posix.normalize(resourcePath)
const cache = const cache =
fileBaseName === 'favicon' fileBaseName === 'favicon'
? 'public, max-age=0, must-revalidate' ? 'public, max-age=0, must-revalidate'
...@@ -107,7 +105,7 @@ const buffer = Buffer.from(${JSON.stringify( ...@@ -107,7 +105,7 @@ const buffer = Buffer.from(${JSON.stringify(
if (${isTwitter || isOpenGraph}) { if (${isTwitter || isOpenGraph}) {
const fileSizeInMB = buffer.byteLength / 1024 / 1024 const fileSizeInMB = buffer.byteLength / 1024 / 1024
if (fileSizeInMB > ${fileSizeLimit}) { 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\` + \`(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' '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