improve codebase

This commit is contained in:
Rene
2020-10-25 13:28:23 +01:00
parent 29af442b38
commit 3cd6c2b85d
12 changed files with 177 additions and 70 deletions
+4 -4
View File
@@ -1,21 +1,21 @@
module.exports = function (api) {
api.cache.using(() => process.env.NODE_ENV);
const isRollup = api.caller((caller) => !!(caller && caller.name === 'babel-rollup-build'));
const isJest = api.caller((caller) => !!(caller && caller.name === 'babel-jest'));
if (api.env('build')) {
if (isRollup) {
return {
plugins: ['@babel/plugin-transform-runtime', '@babel/plugin-proposal-class-properties'],
};
}
if (api.env('test')) {
if (isJest) {
return {
plugins: ['@babel/plugin-transform-modules-commonjs'],
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: { version: 3, proposals: true },
targets: {
node: 'current',
},