Skip to content

Commit

Permalink
fix: Allow using .swcrc when no option defined (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
foray1010 authored Jan 20, 2024
1 parent cb47d61 commit 3e2d31f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ const nodeTargetDefaults = new Map([

function buildSwcTransformOpts(swcOptions: (Options & { experimental?: unknown }) | undefined): Options {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { experimental, ...computedSwcOptions } = swcOptions || (getOptionsFromSwrc() as Options & { experimental?: unknown })
const { experimental, ...computedSwcOptions } =
swcOptions && Object.keys(swcOptions).length > 0
? swcOptions
: getOptionsFromSwrc() as Options & { experimental?: unknown }

if (!computedSwcOptions.env && !computedSwcOptions.jsc?.target) {
set(
Expand Down

0 comments on commit 3e2d31f

Please sign in to comment.