Minify search-index in one pass

This commit is contained in:
Guillaume Gomez 2019-01-10 21:26:41 +01:00
parent f42407f114
commit 2e8fd44598

View File

@ -1057,11 +1057,11 @@ themePicker.onblur = handleThemeButtonsBlur;
all_indexes.sort();
let mut w = try_err!(File::create(&dst), &dst);
try_err!(writeln!(&mut w, "var N = null;var searchIndex = {{}};"), &dst);
for index in &all_indexes {
try_err!(write_minify_replacer(&mut w, &*index, options.enable_minification,
try_err!(write_minify_replacer(&mut w,
&all_indexes.join("\n"),
options.enable_minification,
&[(minifier::js::Keyword::Null, "N")]),
&dst);
}
try_err!(writeln!(&mut w, "initSearch(searchIndex);addSearchOptions(searchIndex);"), &dst);
if options.enable_index_page {