Total Complexity | 2 |
Complexity/F | 2 |
Lines of Code | 28 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
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 |