-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.babelrc.js
32 lines (30 loc) · 886 Bytes
/
.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
module.exports = function (api) {
api.cache(() => [process.env.NODE_ENV || 'development', process.env.BUILD_SSR || 'false'].join(':'));
const config = {
presets: [
'@babel/preset-typescript',
[
'@babel/env',
{
modules: false,
loose: true,
bugfixes: true,
targets: {
esmodules: true,
},
},
],
],
plugins: [
[
'@babel/plugin-transform-react-jsx',
{
pragma: 'h',
pragmaFrag: 'Fragment',
},
],
process.env.BUILD_SSR ? ['babel-plugin-dynamic-import-node-sync'] : null,
].filter(Boolean),
};
return config;
};