Skip to main content

minify_js

Function minify_js 

Source
pub fn minify_js(js: &str) -> String
Expand description

Minifies JavaScript by removing comments and collapsing whitespace.

ssg’s own implementation rather than a dependency. It is deliberately conservative: it does not rename, reorder or rewrite anything, so it cannot change what a script does. String literals, regex literals and the division operator are all left alone.