C
C
claus_bor2018-05-11 09:42:33
JavaScript
claus_bor, 2018-05-11 09:42:33

Babel doesn't understand spread operator?

I have two folders:

my-project
  popup
    src
      index.js
  frontend

In the frontend folder there is spa on vue.js, in the popup folder I put the form elements that are used as popup, the project structure should be exactly like this. I did npm link in popup and then npm link ../popup in frontend folder to make local path and use popup as package.
But using the ui-kit package in the frontend I get an error:
5af53b27b801f296767051.png
That is, babel cannot understand the spread operator from the popup folder. How can this be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pushkarev, 2018-05-11
@AXP-dev

In .babelrcadd plugintransform-object-rest-spread

.babelrc example
{
  "presets": [
    [
      "env",
      {
        "modules": false,
        "targets": {
          "browsers": ["last 2 versions", "ie >= 10"]
        }
      }
    ]
  ],
  "plugins": ["transform-object-rest-spread"],
  "comments": false
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question