Skip to content

Commit

Permalink
fix filepath separator in __entry_css_files__
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Dec 23, 2022
1 parent fd0d0f5 commit 9a505bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/next/build/webpack/plugins/flight-manifest-plugin.ts
Original file line number Diff line number Diff line change
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

0 comments on commit 9a505bd

Please # to comment.