Skip to content

Commit 9a505bd

Browse files
committed
fix filepath separator in __entry_css_files__
1 parent fd0d0f5 commit 9a505bd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/next/build/webpack/plugins/flight-manifest-plugin.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { webpack, sources } from 'next/dist/compiled/webpack/webpack'
99
import { FLIGHT_MANIFEST } from '../../../shared/lib/constants'
10-
import { relative } from 'path'
10+
import { relative, sep } from 'path'
1111
import { isClientComponentModule, regexCSS } from '../loaders/utils'
1212

1313
import {
@@ -349,7 +349,9 @@ export class FlightManifestPlugin {
349349
entryName: string | undefined | null
350350
) => {
351351
if (entryName?.startsWith('app/')) {
352-
const key = this.appDir + entryName.slice(3)
352+
// The `key` here should be the absolute file path but without extension.
353+
// We need to replace the separator in the entry name to match the system separator.
354+
const key = this.appDir + entryName.slice(3).replace(/\//g, sep)
353355
entryCSSFiles[key] = files.concat(entryCSSFiles[key] || [])
354356
}
355357
}

0 commit comments

Comments
 (0)