Struct deno_ast::EmitOptions

source ·
pub struct EmitOptions {
    pub emit_metadata: bool,
    pub imports_not_used_as_values: ImportsNotUsedAsValues,
    pub inline_source_map: bool,
    pub inline_sources: bool,
    pub jsx_automatic: bool,
    pub jsx_development: bool,
    pub jsx_factory: String,
    pub jsx_fragment_factory: String,
    pub jsx_import_source: Option<String>,
    pub source_map: bool,
    pub transform_jsx: bool,
    pub var_decl_imports: bool,
}
Expand description

Options which can be adjusted when transpiling a module.

This implements Hash so the CLI can use it to bust the emit cache.

Fields§

§emit_metadata: bool

When emitting a legacy decorator, also emit experimental decorator meta data. Defaults to false.

§imports_not_used_as_values: ImportsNotUsedAsValues

What to do with import statements that only import types i.e. whether to remove them (Remove), keep them as side-effect imports (Preserve) or error (Error). Defaults to Remove.

§inline_source_map: bool

Should the source map be inlined in the emitted code file, or provided as a separate file. Defaults to true.

§inline_sources: bool

Should the sources be inlined in the source map. Defaults to true.

§jsx_automatic: bool

true if the program should use an implicit JSX import source/the “new” JSX transforms.

§jsx_development: bool

If JSX is automatic, if it is in development mode, meaning that it should import jsx-dev-runtime and transform JSX using jsxDEV import from the JSX import source as well as provide additional debug information to the JSX factory.

§jsx_factory: String

When transforming JSX, what value should be used for the JSX factory. Defaults to React.createElement.

§jsx_fragment_factory: String

When transforming JSX, what value should be used for the JSX fragment factory. Defaults to React.Fragment.

§jsx_import_source: Option<String>

The string module specifier to implicitly import JSX factories from when transpiling JSX.

§source_map: bool

Should a corresponding .map file be created for the output. This should be false if inline_source_map is true. Defaults to false.

§transform_jsx: bool

Should JSX be transformed. Defaults to true.

§var_decl_imports: bool

Should import declarations be transformed to variable declarations using a dynamic import. This is useful for import & export declaration support in script contexts such as the Deno REPL. Defaults to false.

Trait Implementations§

source§

impl Clone for EmitOptions

source§

fn clone(&self) -> EmitOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EmitOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for EmitOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Hash for EmitOptions

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> Send for T
where T: ?Sized,

source§

impl<T> Sync for T
where T: ?Sized,