Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CSS resource path not matched in __entry_css_files__ #44310

Merged
merged 1 commit into from Dec 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -7,7 +7,7 @@

import { webpack, sources } from 'next/dist/compiled/webpack/webpack'
import { FLIGHT_MANIFEST } from '../../../shared/lib/constants'
import { relative } from 'path'
import { relative, sep } from 'path'
import { isClientComponentModule, regexCSS } from '../loaders/utils'

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