Skip to content

Commit

Permalink
Use resolved url in flight entry loader
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Sep 19, 2022
1 parent a03cdc6 commit bd8454d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -41,9 +41,16 @@ export default async function transformSource(this: any): Promise<string> {
`

const buildInfo = getModuleBuildInfo(this._module)
const resolve = this.getResolve()

// Resolve to absolute resource url for flight manifest to collect and use to determine client components
const resolvedRequests = await Promise.all(
requests.map(async (r) => await resolve(this.rootContext, r))
)

buildInfo.rsc = {
type: RSC_MODULE_TYPES.client,
requests,
requests: resolvedRequests,
}

return code
Expand Down
Expand Up @@ -112,7 +112,7 @@ export class FlightManifestPlugin {
if (mod.resource === '' && mod.buildInfo.rsc) {
const { requests = [] } = mod.buildInfo.rsc
requests.forEach((r: string) => {
clientRequestsSet.add(require.resolve(r))
clientRequestsSet.add(r)
})
}
}
Expand Down

0 comments on commit bd8454d

Please sign in to comment.