mirror of
https://github.com/swc-project/swc.git
synced 2024-12-23 21:54:36 +03:00
fix(node/bundler): Prevent spreading string into return (#2335)
This commit is contained in:
parent
a7357ab517
commit
f42616698c
@ -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}`);
|
||||
|
Loading…
Reference in New Issue
Block a user