1
1
use lightningcss:: stylesheet:: { ParserOptions , PrinterOptions } ;
2
- // use swc::{try_with_handler, HandlerOpts, config::{JsMinifyOptions, Options}, BoolOrDataConfig};
3
- // use swc_common::{SourceMap, GLOBALS, FileName};
4
2
5
3
pub fn minify_html ( input : String ) -> Result < String , String > {
6
4
String :: from_utf8 ( minify_html:: minify (
@@ -13,42 +11,9 @@ pub fn minify_html(input: String) -> Result<String, String> {
13
11
}
14
12
15
13
pub fn minify_js ( input : String ) -> Result < String , String > {
16
- // minify
17
- return Ok ( input) ;
18
- // let cm = Arc::<SourceMap>::default();
19
- // let c = swc::Compiler::new(cm.clone());
20
-
21
- // GLOBALS.set(&Default::default(), || {
22
- // try_with_handler(
23
- // cm.clone(),
24
- // HandlerOpts {
25
- // ..Default::default()
26
- // },
27
- // |handler| {
28
- // let mut fm = cm.new_source_file(FileName::Anon, input);
29
- // let output = c.process_js_file(
30
- // fm.clone(),
31
- // handler,
32
- // &Options {
33
- // ..Default::default()
34
- // }
35
- // )?;
36
- // // idk if there's a better way to do this lol
37
- // fm = cm.new_source_file(FileName::Anon, output.code);
38
- // c.minify(
39
- // fm,
40
- // handler,
41
- // &JsMinifyOptions {
42
- // compress: BoolOrDataConfig::from_bool(true),
43
- // mangle: BoolOrDataConfig::from_bool(true),
44
- // ..Default::default()
45
- // },
46
- // )
47
- // }
48
- // )
49
- // })
50
- // .map(|o| o.code)
51
- // .map_err(|e| format!("{e}"))
14
+ // TODO: implement this
15
+ // swc is a stupidly big dependency, and minify_js fails with an assertion
16
+ Ok ( input)
52
17
}
53
18
54
19
pub fn minify_css ( input : String ) -> Result < String , String > {
0 commit comments