【问题标题】:Atom Quokka plugin error: Unexpected token import when importing a module written with ES6 -Atom Quokka 插件错误:导入用 ES6 编写的模块时出现意外的令牌导入 -
【发布时间】:2018-05-24 18:15:21
【问题描述】:

我正在尝试使用 WallabyJS https://github.com/wallabyjs/atom-quokka 的精彩 Quokka 包。

我正在尝试导入 ES6 模块,但在 Quokka 控制台中不断出现错误:

在 createScript vm.js:56 处意外导入令牌

我已尝试更新我的 package.json 文件并按照配置页面 here 中的建议设置 babel: true 但我仍然收到错误。

链接到我的 package.json 文件here

【问题讨论】:

    标签: atom-editor wallaby.js quokka.js


    【解决方案1】:

    您需要在 Quokka 配置中使用 specify react-app preset,因此您需要:而不是“babel: true”:

    babel: {
        presets: ['react-app']
    }
    

    【讨论】:

    猜你喜欢
    • 2020-12-30
    • 2019-03-21
    • 2018-11-24
    • 2017-02-01
    • 1970-01-01
    • 2018-01-20
    • 2019-08-09
    • 1970-01-01
    • 2016-11-14
    相关资源
    最近更新 更多