Skip to content

Commit

Permalink
fix(core): enforce sourcemap: 'inline' for jest
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Feb 15, 2023
1 parent 860d1f6 commit 045628e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export interface Options {
function transformOption(path: string, options?: Options, jest = false): SwcOptions {
const opts = options == null ? {} : options
opts.esModuleInterop = opts.esModuleInterop ?? true
const sourceMapDefault = jest ? 'inline' : true
return {
filename: path,
jsc: {
Expand Down Expand Up @@ -59,7 +58,7 @@ function transformOption(path: string, options?: Options, jest = false): SwcOpti
type: options?.module ?? 'commonjs',
noInterop: !opts.esModuleInterop,
},
sourceMaps: typeof opts.sourcemap === 'undefined' ? sourceMapDefault : opts.sourcemap,
sourceMaps: jest || typeof opts.sourcemap === 'undefined' ? 'inline' : opts.sourcemap,
inlineSourcesContent: true,
swcrc: false,
...(options?.swc ?? {}),
Expand Down

0 comments on commit 045628e

Please sign in to comment.