Skip to content

Commit

Permalink
Fix cannot use .swcrc when no option defined
Browse files Browse the repository at this point in the history
  • Loading branch information
foray1010 committed Nov 4, 2023
1 parent 163127e commit 0f59eec
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 0f59eec

Please sign in to comment.