mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 05:12:31 +02:00
perf(v2): replace unnecessary json stringify(string) with inline string (#2039)
This commit is contained in:
parent
cea224b03d
commit
3aa2ab6ab3
1 changed files with 2 additions and 4 deletions
|
@ -99,7 +99,7 @@ export async function load(siteDir: string): Promise<Props> {
|
||||||
`export default [\n${clientModules
|
`export default [\n${clientModules
|
||||||
// import() is async so we use require() because client modules can have
|
// import() is async so we use require() because client modules can have
|
||||||
// CSS and the order matters for loading CSS.
|
// CSS and the order matters for loading CSS.
|
||||||
.map(module => ` require(${JSON.stringify(module)}),`)
|
.map(module => ` require("${module}"),`)
|
||||||
.join('\n')}\n];\n`,
|
.join('\n')}\n];\n`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -119,9 +119,7 @@ ${Object.keys(registry)
|
||||||
.sort()
|
.sort()
|
||||||
.map(
|
.map(
|
||||||
key =>
|
key =>
|
||||||
` '${key}': [${registry[key].loader}, ${JSON.stringify(
|
` '${key}': [${registry[key].loader}, "${registry[key].modulePath}", require.resolveWeak("${registry[key].modulePath}")],`,
|
||||||
registry[key].modulePath,
|
|
||||||
)}, require.resolveWeak(${JSON.stringify(registry[key].modulePath)})],`,
|
|
||||||
)
|
)
|
||||||
.join('\n')}};\n`,
|
.join('\n')}};\n`,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue