From 6ac2a747c8c09e8a64e1596e84a73c80f3322820 Mon Sep 17 00:00:00 2001 From: abhijithvijayan <34790378+abhijithvijayan@users.noreply.github.com> Date: Thu, 31 Oct 2019 07:07:40 +0530 Subject: [PATCH] add babel plugins to provide spread operations & destructuring --- .babelrc | 7 +++++++ package.json | 2 ++ 2 files changed, 9 insertions(+) diff --git a/.babelrc b/.babelrc index 3dfdfae..0d94d2b 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,7 @@ { "presets": [ [ + // Latest stable ECMAScript features "@babel/preset-env", { "targets": { @@ -12,9 +13,15 @@ ] ], "plugins": [ + // Some transforms (such as object-rest-spread) + // don't work without it: https://github.com/babel/babel/issues/7215 + ["@babel/plugin-transform-destructuring", { "useBuiltIns": true }], + ["@babel/plugin-proposal-object-rest-spread", { "useBuiltIns": true }], [ + // Polyfills the runtime needed for async/await and generators "@babel/plugin-transform-runtime", { + "helpers": false, "regenerator": true } ] diff --git a/package.json b/package.json index 0508523..b2adec1 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,8 @@ }, "devDependencies": { "@babel/core": "^7.6.4", + "@babel/plugin-proposal-object-rest-spread": "^7.6.2", + "@babel/plugin-transform-destructuring": "^7.6.0", "@babel/plugin-transform-runtime": "^7.6.2", "@babel/preset-env": "^7.6.3", "autoprefixer": "^9.7.0",