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.

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 or preserved. 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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