Struct swc::PassBuilder[][src]

pub struct PassBuilder<'a, 'b, P: Fold> { /* fields omitted */ }

Builder is used to create a high performance Compiler.


impl<'a, 'b, P: Fold> PassBuilder<'a, 'b, P>[src]

pub fn new(
    cm: &'a Arc<SourceMap>,
    handler: &'b Handler,
    loose: bool,
    global_mark: Mark,
    pass: P
) -> Self

pub fn then<N>(self, next: N) -> PassBuilder<'a, 'b, AndThen<P, N>> where
    N: Fold

pub fn skip_helper_injection(self, skip: bool) -> Self[src]

pub fn fixer(self, enable: bool) -> Self[src]

Note: fixer is enabled by default.

pub fn hygiene(self, config: Option<Config>) -> Self[src]

Note: hygiene is enabled by default.

If you pass None to this method, the hygiene pass will be disabled.

pub fn const_modules(
    globals: HashMap<JsWord, HashMap<JsWord, String>>
) -> PassBuilder<'a, 'b, impl Fold>

pub fn inline_globals(
    c: GlobalPassOption
) -> PassBuilder<'a, 'b, impl Fold>

pub fn target(self, target: JscTarget) -> Self[src]

pub fn preset_env(self, env: Option<Config>) -> Self[src]

pub fn finalize<'cmt>(
    paths: Vec<(String, Vec<String>)>,
    base: &FileName,
    syntax: Syntax,
    module: Option<ModuleConfig>,
    comments: Option<&'cmt dyn Comments>
) -> impl 'cmt + Fold where
    P: 'cmt, 



  • Use None if you want swc to emit import statements.

Returned pass includes

  • compatibility helper
  • module handler
  • helper injector
  • identifier hygiene handler if enabled
  • fixer if enabled

Auto Trait Implementations

impl<'a, 'b, P> !RefUnwindSafe for PassBuilder<'a, 'b, P>

impl<'a, 'b, P> Send for PassBuilder<'a, 'b, P> where
    P: Send

impl<'a, 'b, P> Sync for PassBuilder<'a, 'b, P> where
    P: Sync

impl<'a, 'b, P> Unpin for PassBuilder<'a, 'b, P> where
    P: Unpin

impl<'a, 'b, P> !UnwindSafe for PassBuilder<'a, 'b, P>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Node for T where
    T: Any + ?Sized

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.