Skip to content

Commit

Permalink
fix(register): inline sourcemap (#708)
Browse files Browse the repository at this point in the history
* fix-inline-sourcemap

Fixes inline sourcemaps by passing along inline to swc when specified in tsconfig.

* update all values config test
  • Loading branch information
robbiespeed authored Apr 11, 2023
1 parent 68e7c16 commit 07eec33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ test('should set all values', (t) => {
const swcConfig = tsCompilerOptionsToSwcConfig(options, filename)
const expected = {
module: 'commonjs',
sourcemap: options.sourceMap,
sourcemap: 'inline',
experimentalDecorators: options.experimentalDecorators,
emitDecoratorMetadata: options.emitDecoratorMetadata,
esModuleInterop: options.esModuleInterop,
Expand Down
2 changes: 1 addition & 1 deletion packages/register/read-default-tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function tsCompilerOptionsToSwcConfig(options: ts.CompilerOptions, filena
const isJsx = filename.endsWith('.tsx') || filename.endsWith('.jsx') || Boolean(options.jsx)
return {
module: toModule(options.module ?? ts.ModuleKind.ES2015),
sourcemap: Boolean(options.sourceMap),
sourcemap: options.sourceMap && options.inlineSourceMap ? 'inline' : Boolean(options.sourceMap),
experimentalDecorators: options.experimentalDecorators ?? false,
emitDecoratorMetadata: options.emitDecoratorMetadata ?? false,
esModuleInterop: options.esModuleInterop ?? false,
Expand Down

0 comments on commit 07eec33

Please sign in to comment.