Skip to content

Commit

Permalink
add support for match resource
Browse files Browse the repository at this point in the history
append querystring to mod.matchResource
  • Loading branch information
jantimon committed Aug 10, 2023
1 parent 1276771 commit 399923e
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -186,9 +186,13 @@ export class FlightClientEntryPlugin {

compiler.hooks.afterCompile.tap(PLUGIN_NAME, (compilation) => {
const recordModule = (modId: string, mod: any) => {
const modResource =
mod.resourceResolveData?.path + mod.resourceResolveData?.query ||
mod.resource
// Match Resource is undefined unless an import is using the inline match resource syntax
// https://webpack.js.org/api/loaders/#inline-matchresource
const modPath = mod.matchResource || mod.resourceResolveData?.path
const modQuery = mod.resourceResolveData?.query || ''
// query is already part of mod.resource
// so it's only neccessary to add it for matchResource or mod.resourceResolveData
const modResource = modPath ? modPath + modQuery : mod.resource

if (mod.layer !== WEBPACK_LAYERS.serverSideRendering) {
return
Expand Down

0 comments on commit 399923e

Please sign in to comment.