summaryrefslogtreecommitdiff
path: root/cli/args/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r--cli/args/mod.rs26
1 files changed, 20 insertions, 6 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs
index 34448e633..13ee9eeef 100644
--- a/cli/args/mod.rs
+++ b/cli/args/mod.rs
@@ -158,10 +158,8 @@ pub fn ts_config_to_emit_options(
_ => (false, false, false, false),
};
deno_ast::EmitOptions {
- // TODO(bartlomieju): change it to default to `false` and only enable
- // if tsconfig.json enabled experimental decorators
- use_ts_decorators: true,
- use_decorators_proposal: false,
+ use_ts_decorators: options.experimental_decorators,
+ use_decorators_proposal: !options.experimental_decorators,
emit_metadata: options.emit_decorator_metadata,
imports_not_used_as_values,
inline_source_map: options.inline_source_map,
@@ -1088,10 +1086,26 @@ impl CliOptions {
&self,
config_type: TsConfigType,
) -> Result<TsConfigForEmit, AnyError> {
- deno_config::get_ts_config_for_emit(
+ let result = deno_config::get_ts_config_for_emit(
config_type,
self.maybe_config_file.as_ref(),
- )
+ );
+
+ match result {
+ Ok(mut ts_config_for_emit) => {
+ if matches!(self.flags.subcommand, DenoSubcommand::Bundle(..)) {
+ // For backwards compatibility, force `experimentalDecorators` setting
+ // to true.
+ *ts_config_for_emit
+ .ts_config
+ .0
+ .get_mut("experimentalDecorators")
+ .unwrap() = serde_json::Value::Bool(true);
+ }
+ Ok(ts_config_for_emit)
+ }
+ Err(err) => Err(err),
+ }
}
pub fn resolve_inspector_server(&self) -> Option<InspectorServer> {