Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are dart polymer transformer entry_points actually for?

Dart apps using polymer.dart have their pubspec.yaml file looking like this (from the Polymer.dart Code Lab):

name: polymer_and_dart
description: Sample app built with the polymer.dart package
environment:
  sdk: '>=1.2.0 <2.0.0'
dependencies:
  polymer: '>=0.12.0 <0.13.0'
dev_dependencies:
  unittest: '>=0.10.0 <0.11.0'
transformers:
- polymer:
    entry_points:
    - web/begin/index.html
    - web/end/index.html

What do the entry_points actually mean? What does declaring an entry point actually do?

like image 968
zegkljan Avatar asked Feb 12 '23 17:02

zegkljan


2 Answers

This is the file where the transformer starts looking for polymer related files where it needs to do code generation and other modifications. The transformer follows HTML imports and Dart script tags.

An entry point is the main HTML files of a Polymer application (like index.html). Other files like custom elements are found automatically through imports.

For normal applications you might have only one entry point but for example a package of polymer elements like core_elements or paper_elements have a demo application page for each custom element in the package. Each such demo application is an entry point (normally in the example folder instead of web.

like image 122
Günter Zöchbauer Avatar answered Feb 15 '23 02:02

Günter Zöchbauer


From the Building part of Polymer.dart page:

You can use entry_points to specify which pages under web the user can navigate to. (By default, all pages under web are entry points.)

like image 38
Alexandre Ardhuin Avatar answered Feb 15 '23 00:02

Alexandre Ardhuin