babel.config.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 28
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 17
mnd 1
bc 1
fnc 1
dl 0
loc 28
bpm 1
cpm 2
noi 0
c 0
b 0
f 0
rs 10
1
export default (api) => {
2
  api.cache(true);
3
4
  const presets = [
5
    [
6
      '@babel/preset-env',
7
      {
8
        targets: {
9
          esmodules: true,
10
        },
11
        modules: false, // Output ES modules
12
      },
13
    ],
14
    'minify', // minify the Babel code
15
  ];
16
17
  // Add the istanbul plugin for coverage instrumentation in test environment
18
  const plugins = [];
19
  if (process.env.NODE_ENV === 'test') {
20
    plugins.push('babel-plugin-istanbul');
21
  }
22
23
  return {
24
    presets,
25
    plugins,
26
    comments: false, // Remove comments during minification
27
  };
28
};
29