Reduce search-index.js size

This commit is contained in:
Guillaume Gomez 2018-12-16 02:35:39 +01:00
parent ceb2512144
commit f42407f114
3 changed files with 8 additions and 5 deletions

View file

@ -9,6 +9,6 @@ path = "lib.rs"
[dependencies]
pulldown-cmark = { version = "0.1.2", default-features = false }
minifier = "0.0.20"
minifier = "0.0.21"
tempfile = "3"
parking_lot = "0.6.4"

View file

@ -1223,7 +1223,10 @@ fn write_minify_replacer<W: Write>(dst: &mut W,
-> io::Result<()> {
if enable_minification {
writeln!(dst, "{}",
minifier::js::minify_and_replace_keywords(contents, keywords_to_replace))
minifier::js::minify_and_replace_keywords(contents, keywords_to_replace)
.apply(minifier::js::clean_tokens)
.apply(minifier::js::aggregate_strings)
.to_string())
} else {
writeln!(dst, "{}", contents)
}