Some code cleanup, add jest coverage and begin using it for utility functions
This commit is contained in:
parent
ca39830333
commit
1eb3ea2ee4
29 changed files with 2044 additions and 134 deletions
|
@ -1,14 +1,6 @@
|
|||
module.exports = {
|
||||
presets: [
|
||||
'@babel/typescript',
|
||||
['@babel/env', {
|
||||
modules: false,
|
||||
useBuiltIns: 'entry',
|
||||
corejs: 3,
|
||||
}],
|
||||
'@babel/react',
|
||||
],
|
||||
plugins: [
|
||||
module.exports = function (api) {
|
||||
let targets = {};
|
||||
const plugins = [
|
||||
'babel-plugin-macros',
|
||||
'styled-components',
|
||||
'react-hot-loader/babel',
|
||||
|
@ -19,5 +11,24 @@ module.exports = {
|
|||
'@babel/proposal-optional-chaining',
|
||||
'@babel/proposal-nullish-coalescing-operator',
|
||||
'@babel/syntax-dynamic-import',
|
||||
],
|
||||
];
|
||||
|
||||
if (api.env('test')) {
|
||||
targets = { node: 'current' };
|
||||
plugins.push('@babel/transform-modules-commonjs');
|
||||
}
|
||||
|
||||
return {
|
||||
plugins,
|
||||
presets: [
|
||||
'@babel/typescript',
|
||||
['@babel/env', {
|
||||
modules: false,
|
||||
useBuiltIns: 'entry',
|
||||
corejs: 3,
|
||||
targets,
|
||||
}],
|
||||
'@babel/react',
|
||||
]
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue