forked from salute-developers/plasma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.babelrc.js
41 lines (38 loc) · 1.01 KB
/
.babelrc.js
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
31
32
33
34
35
36
37
38
39
40
41
const namespace = process.env.SC_NAMESPACE;
const plugins = [
'@babel/plugin-proposal-class-properties',
'babel-plugin-annotate-pure-calls',
'@babel/plugin-transform-react-constant-elements',
[
'babel-plugin-styled-components',
{
displayName: false,
namespace,
},
],
];
const ignore = ['**/*.d.ts', '**/helpers', '**/__helpers', '**/*.stories.tsx'];
process.env.COVERAGE && plugins.push(['babel-plugin-istanbul']);
module.exports = {
env: {
cjs: {
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'],
plugins,
ignore,
},
esm: {
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins,
ignore,
},
},
};