Skip to content

Commit

Permalink
Adjust client components module detection in TraceEntryPointsPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable committed Oct 28, 2024
1 parent 1445b93 commit cc6e954
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { getPageFilePath } from '../../entries'
import { resolveExternal } from '../../handle-externals'
import swcLoader from '../loaders/next-swc-loader'
import { isMetadataRoute } from '../../../lib/metadata/is-metadata-route'
import { isClientComponentEntryModule } from '../loaders/utils'

const PLUGIN_NAME = 'TraceEntryPointsPlugin'
export const TRACE_IGNORES = [
Expand Down Expand Up @@ -533,10 +534,7 @@ export class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {
// fallback to reading raw source file, this may fail
// due to unsupported syntax but best effort attempt
let usingOriginalSource = false
if (
!source ||
source.toString().includes('next-flight-loader/module-proxy')
) {
if (!source || isClientComponentEntryModule(mod)) {
source = await readOriginalSource(path)
usingOriginalSource = true
}
Expand Down

0 comments on commit cc6e954

Please sign in to comment.