mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 12:52: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
|
||||
// import() is async so we use require() because client modules can have
|
||||
// CSS and the order matters for loading CSS.
|
||||
.map(module => ` require(${JSON.stringify(module)}),`)
|
||||
.map(module => ` require("${module}"),`)
|
||||
.join('\n')}\n];\n`,
|
||||
);
|
||||
|
||||
|
@ -119,9 +119,7 @@ ${Object.keys(registry)
|
|||
.sort()
|
||||
.map(
|
||||
key =>
|
||||
` '${key}': [${registry[key].loader}, ${JSON.stringify(
|
||||
registry[key].modulePath,
|
||||
)}, require.resolveWeak(${JSON.stringify(registry[key].modulePath)})],`,
|
||||
` '${key}': [${registry[key].loader}, "${registry[key].modulePath}", require.resolveWeak("${registry[key].modulePath}")],`,
|
||||
)
|
||||
.join('\n')}};\n`,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue