add babel plugins to provide spread operations & destructuring

This commit is contained in:
abhijithvijayan 2019-10-31 07:07:40 +05:30
parent 4e5683c45e
commit 6ac2a747c8
2 changed files with 9 additions and 0 deletions

View File

@ -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
}
]

View File

@ -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",