Skip to content

Commit

Permalink
fix(node/bundler): Prevent spreading string into return (#2335)
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshydra authored Oct 3, 2021
1 parent a7357ab commit f426166
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node-swc/src/spack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit f426166

Please sign in to comment.