minify_js_str

Macro minify_js_str 

Source
minify_js_str!() { /* proc-macro */ }
Expand description

Produce a minified js from string.

use static_web_minify::minify_js_str;

const JS: &str = minify_js_str!(r#"
    function my_func() {
        // Great !
    }
"#);
 
assert_eq!(JS, "var my_func=(()=>{})");
use static_web_minify::minify_js_str;

const JS: &str = minify_js_str!("
    function my_func() {
        // Great !
    }
");
 
assert_eq!(JS, "var my_func=(()=>{})");