Babel unexpected token import when running mocha tests

前端 未结 17 1538
Happy的楠姐
Happy的楠姐 2020-11-27 14:40

The solutions offered in other related questions, such as including the proper presets (es2015) in .babelrc, are already implemented in my project.

I have two projec

17条回答
  •  心在旅途
    2020-11-27 14:48

    for a more future proof setting

    npm install babel-preset-latest --save-dev
    

    and in .babelrc

    {
      "presets": [ "latest" ]
    }
    

    as opposed to...

    npm install babel-preset-es2015 --save-dev
    

    and

    {
     "presets": [ "es2015" ]
    }
    

提交回复
热议问题