-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbabel.config.js
More file actions
30 lines (29 loc) · 856 Bytes
/
babel.config.js
File metadata and controls
30 lines (29 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const instrumentForCodeCoverage = process.env.COVERAGE === 'true';
const moduleResolver = require('./config/moduleResolver');
/**
* Used by e2e tests. Instruments the code to expose coverage
* info to the browser
*/
const istanbulPlugin = [
'istanbul',
{
exclude: '**/__tests__/**/*',
useInlineSourceMaps: false,
},
];
/**
* NOTE @monitz87: __dirname is necessary here because of
* a bug in babel (see https://github.com/babel/babel/issues/8909)
*/
module.exports = {
babelrcRoots: [__dirname, `${__dirname}/packages/*`],
// babelrcRoots: [__dirname, ]
plugins: [
'@babel/proposal-export-default-from',
'@babel/proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'babel-plugin-styled-components',
moduleResolver('src'),
...(instrumentForCodeCoverage ? [istanbulPlugin] : []),
],
};