1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
mod minify;
mod parse;
mod print;
mod transform;
mod util;

use std::sync::Arc;

use swc::Compiler;
use swc_common::{sync::Lazy, FilePathMapping, SourceMap};

static COMPILER: Lazy<Arc<Compiler>> = Lazy::new(|| {
    let cm = Arc::new(SourceMap::new(FilePathMapping::empty()));

    Arc::new(Compiler::new(cm))
});

fn get_compiler() -> Arc<Compiler> {
    COMPILER.clone()
}