Skip to content

Commit a67e40b

Browse files
Merge pull request TypeStrong#1826 from dragomirtitian/feat-improve-index-loading-perf
Changed how index is loaded to improve performance
2 parents 7ec2b26 + 2767ae9 commit a67e40b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/output/plugins/JavascriptIndexPlugin.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ export class JavascriptIndexPlugin extends RendererComponent {
106106
index,
107107
});
108108

109-
writeFileSync(jsonFileName, `window.searchData = ${jsonData}`);
109+
writeFileSync(
110+
jsonFileName,
111+
`window.searchData = JSON.parse(${JSON.stringify(jsonData)});`
112+
);
110113
}
111114
}

0 commit comments

Comments
 (0)