Unverified Commit a54d08bd authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

Fix windows fill metadata dynamic path (#51885)

Fixes #51583
Fixes NEXT-1315
parent 252c5a69
...@@ -14,6 +14,7 @@ import { getImageSize } from '../../../server/image-optimizer' ...@@ -14,6 +14,7 @@ import { getImageSize } from '../../../server/image-optimizer'
import { imageExtMimeTypeMap } from '../../../lib/mime-type' import { imageExtMimeTypeMap } from '../../../lib/mime-type'
import { fileExists } from '../../../lib/file-exists' import { fileExists } from '../../../lib/file-exists'
import { WEBPACK_RESOURCE_QUERIES } from '../../../lib/constants' import { WEBPACK_RESOURCE_QUERIES } from '../../../lib/constants'
import { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'
interface Options { interface Options {
segment: string segment: string
...@@ -51,7 +52,7 @@ async function nextMetadataImageLoader(this: any, content: Buffer) { ...@@ -51,7 +52,7 @@ async function nextMetadataImageLoader(this: any, content: Buffer) {
const isDynamicResource = pageExtensions.includes(extension) const isDynamicResource = pageExtensions.includes(extension)
const pageSegment = isDynamicResource ? fileNameBase : interpolatedName const pageSegment = isDynamicResource ? fileNameBase : interpolatedName
const hashQuery = contentHash ? '?' + contentHash : '' const hashQuery = contentHash ? '?' + contentHash : ''
const pathnamePrefix = path.join(basePath, segment) const pathnamePrefix = normalizePathSep(path.join(basePath, segment))
if (isDynamicResource) { if (isDynamicResource) {
const mod = await new Promise<webpack.NormalModule>((res, rej) => { const mod = await new Promise<webpack.NormalModule>((res, rej) => {
......
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