Skip to content

Commit 2d2e8ad

Browse files
authored
fix(gatsby): avoid plus2space conversion using json encoded options (#37980)
1 parent c995fb7 commit 2d2e8ad

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

packages/gatsby/src/utils/webpack/plugins/partial-hydration.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,16 +289,20 @@ export class PartialHydrationPlugin {
289289
throw new Error(`couldn't find async-requires module`)
290290
}
291291

292-
const clientSSRLoader = `gatsby/dist/utils/webpack/loaders/client-components-requires-writer-loader?modules=${clientModules
293-
.map(
294-
module =>
295-
`./` +
296-
path.relative(
297-
compilation.options.context as string,
298-
module.userRequest
292+
const clientSSRLoader = `gatsby/dist/utils/webpack/loaders/client-components-requires-writer-loader?${JSON.stringify(
293+
{
294+
modules: clientModules
295+
.map(
296+
module =>
297+
`./` +
298+
path.relative(
299+
compilation.options.context as string,
300+
module.userRequest
301+
)
299302
)
300-
)
301-
.join(`,`)}!`
303+
.join(`,`),
304+
}
305+
)}!`
302306

303307
const clientComponentEntryDep = webpack.EntryPlugin.createDependency(
304308
clientSSRLoader,

0 commit comments

Comments
 (0)