【问题标题】:How can I use ES2016 decorators in karma?如何在业力中使用 ES2016 装饰器?
【发布时间】:2016-02-14 11:54:20
【问题描述】:

我已经在预设中使用karma-babel-preprocessores2015 设置了业力。

我在我的代码中使用了装饰器,但我不知道如何配置 karma 来接受它们。我尝试了一段时间没有成功。

plugins: ['transform-decorators'] 添加到babelPreprocessor 选项没有帮助。

我们将不胜感激。

【问题讨论】:

    标签: karma-runner babeljs ecmascript-2016


    【解决方案1】:

    这是由一个关于装饰器(我正在使用)和 babel 的当前未解决问题引起的。

    在 Babel 中查看这些问题:

    #2645 - Fix Decorators

    #2801 - Failed to transform decorators with babel-plugin-transform-decorators@6.0.14

    #2727 - Decorators are broken in 6.x

    【讨论】:

    猜你喜欢
    • 2016-01-28
    • 2018-06-08
    • 1970-01-01
    • 2020-02-02
    • 2015-01-15
    • 2021-07-19
    • 2011-11-20
    • 1970-01-01
    • 2020-03-23
    相关资源
    最近更新 更多