添加时出错:commandLineOptions:[ - enable-experimental-mirrors]

时间:2016-06-20 03:24:12

标签: dart phpstorm dart2js

将http:添加到我的pub spec.yaml后,我收到了警告。我对它进行了搜索,post说要将其添加到我的pubspec:

- $dart2js:
commandLineOptions: [--enable-experimental-mirrors]

我做了并得到了错误:

Error on line 12, column 3 of pubspec.yaml: A transformer map must have a   single key: the transformer identifier.
- $dart2js:
  ^^^^^^^^^^

在此之前,我的工作pubspec中没有$ dart2js。我有 - dart_to_js_script_rewriter。 pubspec最初由PHPStorm IDE创建。纠正方法有变化吗?这是我完整的pubspec:

name: jazzcat
description: A catalog of jazz music
version: 0.0.1
environment:
  sdk: '>=1.13.0 <2.0.0'
dependencies:
  angular2: 2.0.0-beta.17
  browser: ^0.10.0
  dart_to_js_script_rewriter: ^1.0.1
  http:
transformers:
- $dart2js:
  commandLineOptions: [--enable-experimental-mirrors]
- angular2:
    platform_directives:
    - 'package:angular2/common.dart#COMMON_DIRECTIVES'
    platform_pipes:
    - 'package:angular2/common.dart#COMMON_PIPES'
    entry_points: web/main.dart
- dart_to_js_script_rewriter

1 个答案:

答案 0 :(得分:1)

两个可能的问题:

dart2js变换器必须在Angular变换器之后,因为Angular变换器在编译为JavaScript之前正在处理Dart文件。

第二个问题可能是commandLineOptions键的缩进级别,因为它的缩进级别与其他键不同。