Просмотр исходного кода

ensure to configure babel with babel.config.js

Yuki Takei 7 лет назад
Родитель
Сommit
1e95261c3c
2 измененных файлов с 23 добавлено и 17 удалено
  1. 0 17
      .babelrc
  2. 23 0
      babel.config.js

+ 0 - 17
.babelrc

@@ -1,17 +0,0 @@
-{
-  "plugins": [
-    "lodash",
-  ],
-  "presets": [
-    [
-      "@babel/preset-env",
-      {
-        "targets": {
-          "node": "current",
-        },
-        "useBuiltIns": "usage",
-      }
-    ],
-    "@babel/preset-react"
-  ]
-}

+ 23 - 0
babel.config.js

@@ -0,0 +1,23 @@
+module.exports = function(api) {
+  api.cache(true);
+
+  const presets = [
+    [
+      '@babel/preset-env',
+      {
+        targets: {
+          node: 'current',
+        },
+      },
+    ],
+    '@babel/preset-react',
+  ];
+  const plugins = [
+    'lodash',
+  ];
+
+  return {
+    presets,
+    plugins,
+  };
+};