What are the transformers mean?

softshipper

I have a yaml file with following content:

transformers:
- angular2:
    platform_directives:
    - 'package:angular2/common.dart#COMMON_DIRECTIVES'
    platform_pipes:
    - 'package:angular2/common.dart#COMMON_PIPES'
    entry_points: web/main.dart

What does platform_directives means?

Günter Zöchbauer

Transformers are a feature of the pub tool.

Transformer can transform existing code before it is delivered to the browser. dart2js that transpiles Dart code to JS is also available as transformer (also available as standalone tool)

A transformer is a Dart program that is registered in pubspec.yaml (like shown in your question) and then executed by pub serve or pub build for every source file. A transformer can then take such a source file and modify it before it's passed to the next transformer or to the browser (pub serve or to a file on the disk (pub build). Also new files can be generated.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related