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
impl Clone for EmitOptions
source§fn clone(&self) -> EmitOptions
fn clone(&self) -> EmitOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more