diff --git a/node-swc/src/spack.ts b/node-swc/src/spack.ts index d57e099451b2..3e3a3f5599b7 100644 --- a/node-swc/src/spack.ts +++ b/node-swc/src/spack.ts @@ -22,7 +22,11 @@ export async function compileBundleOptions(config: BundleInput | string | undefi } return configFromFile; } - return Object.assign({}, configFromFile, config); + + return { + ...configFromFile, + ...(typeof config === 'string') ? {} : config + }; } catch (e) { if (typeof f === 'string') { throw new Error(`Error occurred while loading config file at ${config}: ${e}`);