Skip to content

Commit

Permalink
Fix noise
Browse files Browse the repository at this point in the history
  • Loading branch information
IanMitchell committed Jan 15, 2024
1 parent 8e5f088 commit 1f9f0c4
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
var isTestEnv = api.env('test')
module.exports = function (api) {
var validEnv = ['development', 'test', 'production'];
var currentEnv = api.env();
var isDevelopmentEnv = api.env('development');
var isProductionEnv = api.env('production');
var isTestEnv = api.env('test');

if (!validEnv.includes(currentEnv)) {
throw new Error(
Expand All @@ -12,7 +12,7 @@ module.exports = function(api) {
'"test", and "production". Instead, received: ' +
JSON.stringify(currentEnv) +
'.'
)
);
}

return {
Expand All @@ -21,9 +21,9 @@ module.exports = function(api) {
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
node: 'current',
},
},
],
(isProductionEnv || isDevelopmentEnv) && [
'@babel/preset-env',
Expand All @@ -32,9 +32,9 @@ module.exports = function(api) {
useBuiltIns: 'entry',
corejs: 3,
modules: false,
exclude: ['transform-typeof-symbol']
}
]
exclude: ['transform-typeof-symbol'],
},
],
].filter(Boolean),
plugins: [
'babel-plugin-macros',
Expand All @@ -44,29 +44,31 @@ module.exports = function(api) {
[
'@babel/plugin-proposal-class-properties',
{
loose: true
}
loose: true,
},
],
[
'@babel/plugin-proposal-object-rest-spread',
{
useBuiltIns: true
}
useBuiltIns: true,
},
],
[
'@babel/plugin-transform-runtime',
{
helpers: false,
regenerator: true,
corejs: false
}
corejs: false,
},
],
[
'@babel/plugin-transform-regenerator',
{
async: false
}
]
].filter(Boolean)
}
}
async: false,
},
],
['@babel/plugin-transform-private-methods', { loose: true }],
['@babel/plugin-transform-private-property-in-object', { loose: true }],
].filter(Boolean),
};
};

0 comments on commit 1f9f0c4

Please sign in to comment.