Skip to content

Commit

Permalink
fix(register): ensure TS compiler option to SWC config transformer re…
Browse files Browse the repository at this point in the history
…spects inline source map option (#726)

* Ensure SWC config respects TS inline source map option

* Update snapshots

---------

Co-authored-by: LongYinan <lynweklm@gmail.com>
  • Loading branch information
behroozk and Brooooooklyn committed Jul 4, 2024
1 parent 9e53df0 commit 59f2d99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1
`Error: ␊
at /packages/integrate/__tests__/sourcemaps/sourcemaps.spec.ts:27:5
at /packages/integrate/__tests__/sourcemaps/sourcemaps.spec.ts:15:26
at Test.callFn (file:///node_modules/.pnpm/ava@6.1.3_encoding@0.1.13/node_modules/ava/lib/test.js:525:26)␊
at Test.run (file:///node_modules/.pnpm/ava@6.1.3_encoding@0.1.13/node_modules/ava/lib/test.js:534:33)␊
at Runner.runSingle (file:///node_modules/.pnpm/ava@6.1.3_encoding@0.1.13/node_modules/ava/lib/runner.js:281:33)␊
Expand Down
Binary file not shown.
3 changes: 2 additions & 1 deletion packages/register/read-default-tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export function tsCompilerOptionsToSwcConfig(options: ts.CompilerOptions, filena
module: toModule(options.module ?? ts.ModuleKind.ES2015),
target: toTsTarget(target),
jsx: isJsx,
sourcemap: options.sourceMap && options.inlineSourceMap ? 'inline' : Boolean(options.sourceMap),
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
sourcemap: options.sourceMap || options.inlineSourceMap ? 'inline' : Boolean(options.sourceMap),
experimentalDecorators: options.experimentalDecorators ?? false,
emitDecoratorMetadata: options.emitDecoratorMetadata ?? false,
useDefineForClassFields: getUseDefineForClassFields(options, target),
Expand Down

0 comments on commit 59f2d99

Please sign in to comment.