[][src]Struct swc::PassBuilder

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(mut self: Self, skip: bool) -> Self[src]

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

Note: fixer is enabled by default.

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

Note: hygiene is enabled by default.

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(mut self: Self, target: JscTarget) -> Self[src]

pub fn preset_env(mut self: 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>[src]

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

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

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

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

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

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, 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.