Skip to content

Commit 2a9273c

Browse files
author
Ives van Hoorne
committed
Fix Babel config merging
1 parent 0cedfcd commit 2a9273c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/app/src/sandbox/eval/transpilers/babel/babel-parser.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,14 @@ const DEFAULT_BABEL_CONFIG = {
2929
/**
3030
* Parses the .babelrc if it exists, if it doesn't it will return a default config
3131
*/
32-
export default function getBabelConfig(config: Object = {}, path: string) {
33-
let resolvedConfig = DEFAULT_BABEL_CONFIG;
32+
export default function getBabelConfig(config?: Object, path: string) {
33+
const resolvedConfig = config || DEFAULT_BABEL_CONFIG;
3434

35-
resolvedConfig = {
35+
return {
3636
...resolvedConfig,
37-
plugins: config.plugins != null ? config.plugins : resolvedConfig.plugins,
38-
presets: config.presets != null ? config.presets : resolvedConfig.presets,
3937
sourceMaps: 'inline',
4038
sourceFileName: path,
4139
sourceMapTarget: `${path}:transpiled`,
4240
filename: path,
4341
};
44-
45-
return resolvedConfig;
4642
}

0 commit comments

Comments
 (0)