-
-
Notifications
You must be signed in to change notification settings - Fork 235
Expand file tree
/
Copy pathbabel.config.js
More file actions
28 lines (27 loc) · 603 Bytes
/
babel.config.js
File metadata and controls
28 lines (27 loc) · 603 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
module.exports = (api) => {
const isWeb = api.caller((caller) => caller && caller.target === "isWeb");
return {
presets: [
[
"@babel/env",
{
useBuiltIns: isWeb ? "usage" : undefined,
corejs: isWeb ? 3 : false,
},
],
"@babel/typescript",
[
"@babel/react",
{
runtime: "automatic",
},
],
],
plugins: ["@loadable/babel-plugin", "@babel/plugin-transform-runtime"],
env: {
development: {
plugins: isWeb ? ["react-refresh/babel"] : undefined,
},
},
};
};