Skip to content

Commit

Permalink
Ensure SWC config respects TS inline source map option
Browse files Browse the repository at this point in the history
  • Loading branch information
behroozk committed Aug 29, 2023
1 parent 9f674cd commit 474992a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/register/read-default-tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,16 @@ export function tsCompilerOptionsToSwcConfig(options: ts.CompilerOptions, filena
module: toModule(options.module ?? ts.ModuleKind.ES2015),
target: toTsTarget(options.target ?? ts.ScriptTarget.ES2018),
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,
esModuleInterop: options.esModuleInterop ?? false,
dynamicImport: true,
keepClassNames: true,
externalHelpers: Boolean(options.importHelpers),
react:
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
options.jsxFactory || options.jsxFragmentFactory || options.jsx || options.jsxImportSource
? {
pragma: options.jsxFactory,
Expand Down

0 comments on commit 474992a

Please sign in to comment.