UNPKG

928 BJavaScriptView Raw
1module.exports = {
2 presets: [
3 '@babel/preset-env',
4 '@babel/preset-typescript',
5 '@babel/preset-react',
6 ],
7 plugins: ['@babel/plugin-proposal-class-properties'],
8 env: {
9 // place plugins for Cypress tests into "test" environment
10 // so that production bundle is not instrumented
11 test: {
12 plugins: [
13 // during Cypress tests we want to instrument source code
14 // to get code coverage from tests
15 'babel-plugin-istanbul',
16 '@babel/plugin-proposal-throw-expressions',
17 // we also want to export ES6 modules as objects
18 // to allow mocking named imports
19 [
20 '@babel/plugin-transform-modules-commonjs',
21 {
22 loose: true,
23 },
24 ],
25 ],
26 },
27 },
28}