Skip to content

Commit ad417fa

Browse files
JSMonkkdy1
andauthored
fix(cli): Fix issue with ignoring --source-file-name (#120)
Currently, if I provide the --source-file-name option to the CLI, it's ignored. This patch fixes the behavior and passes the argument to the CLI implementation. --------- Co-authored-by: Donny/강동윤 <[email protected]>
1 parent 58cf286 commit ad417fa

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/tricky-queens-repeat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@swc/cli": patch
3+
---
4+
5+
Fix issue with ignoring --source-file-name by CLI

packages/cli/src/swc/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export default async function ({
9494
}
9595

9696
async function handle(filename: string) {
97-
const sourceFileName = slash(
97+
const sourceFileName = swcOptions.sourceFileName ?? slash(
9898
cliOptions.outFile
9999
? path.relative(path.dirname(cliOptions.outFile), filename)
100100
: filename

0 commit comments

Comments
 (0)