Struct swc::PassBuilder[][src]

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

Builder is used to create a high performance Compiler.

Implementations

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
[src]

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

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(
    self,
    globals: HashMap<JsWord, HashMap<JsWord, String>>
) -> PassBuilder<'a, 'b, impl Fold>
[src]

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

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

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

pub fn finalize<'cmt>(
    self,
    syntax: Syntax,
    module: Option<ModuleConfig>,
    comments: Option<&'cmt dyn Comments>
) -> impl 'cmt + Fold where
    P: 'cmt, 
[src]

Arguments

module

  • 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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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

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>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.