mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
fix(v2): windows compatibility regression (#2086)
* Revert "perf(v2): replace unnecessary json stringify(string) with inline string (#2039)"
This reverts commit 3aa2ab6ab3
.
* add comment
* Comment bois
This commit is contained in:
parent
4927f764e5
commit
d592e3c470
1 changed files with 6 additions and 2 deletions
|
@ -129,7 +129,8 @@ export async function load(siteDir: string): Promise<Props> {
|
|||
`export default [\n${clientModules
|
||||
// import() is async so we use require() because client modules can have
|
||||
// CSS and the order matters for loading CSS.
|
||||
.map(module => ` require("${module}"),`)
|
||||
// We need to JSON.stringify so that if its on windows, backslash are escaped.
|
||||
.map(module => ` require(${JSON.stringify(module)}),`)
|
||||
.join('\n')}\n];\n`,
|
||||
);
|
||||
|
||||
|
@ -152,7 +153,10 @@ ${Object.keys(registry)
|
|||
.sort()
|
||||
.map(
|
||||
key =>
|
||||
` '${key}': [${registry[key].loader}, "${registry[key].modulePath}", require.resolveWeak("${registry[key].modulePath}")],`,
|
||||
// We need to JSON.stringify so that if its on windows, backslash are escaped.
|
||||
` '${key}': [${registry[key].loader}, ${JSON.stringify(
|
||||
registry[key].modulePath,
|
||||
)}, require.resolveWeak(${JSON.stringify(registry[key].modulePath)})],`,
|
||||
)
|
||||
.join('\n')}};\n`,
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue