Skip to content

Commit 0d4d2d9

Browse files
authored
fix(bindings/es): Respect filename option from print() (#11264)
**Description:** I'm not sure if sourcemap will work correctly, though
1 parent c270c70 commit 0d4d2d9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bindings/binding_core_node/src/print.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ impl Task for PrintTask {
4848
codegen_config: swc_core::ecma::codegen::Config::default()
4949
.with_target(options.config.jsc.target.unwrap_or(EsVersion::Es2020))
5050
.with_minify(options.config.minify.into_bool()),
51+
source_file_name: Some(&options.filename),
5152
..Default::default()
5253
},
5354
)
@@ -108,6 +109,7 @@ pub fn print_sync(program: String, options: Buffer) -> napi::Result<TransformOut
108109
codegen_config: swc_core::ecma::codegen::Config::default()
109110
.with_target(codegen_target)
110111
.with_minify(options.config.minify.into_bool()),
112+
source_file_name: Some(&options.filename),
111113
..Default::default()
112114
},
113115
)

0 commit comments

Comments
 (0)