OLD | NEW |
1 <p>The <a href="pub-serve.html"><code>pub serve</code></a> and <a href="pub-buil
d.html"><code>pub build</code></a> | 1 <p>The <a href="pub-serve.html"><code>pub serve</code></a> and <a href="pub-buil
d.html"><code>pub build</code></a> |
2 commands use <a href="glossary.html#transformer">transformers</a> to prepare a p
ackage’s <a href="glossary.html#asset">assets</a> to be served | 2 commands use <a href="glossary.html#transformer">transformers</a> to prepare a p
ackage’s <a href="glossary.html#asset">assets</a> to be served |
3 locally or to be deployed, respectively.</p> | 3 locally or to be deployed, respectively.</p> |
4 | 4 |
5 <p>Use the <code>pubspec.yaml</code> file to specify which transformers your pac
kage uses | 5 <p>Use the <code>pubspec.yaml</code> file to specify which transformers your pac
kage uses |
6 and, if necessary, to configure the transformers. (See | 6 and, if necessary, to configure the transformers. (See |
7 <a href="#specifying-transformers">Specifying transformers</a> for details.) For
example:</p> | 7 <a href="#specifying-transformers">Specifying transformers</a> for details.) For
example:</p> |
8 | 8 |
9 <pre> | 9 <pre> |
10 name: myapp | 10 name: myapp |
11 dependencies: | 11 dependencies: |
12 <b>polymer: any</b> | 12 <b>polymer: any</b> |
13 <b>transformers: | 13 <b>transformers: |
14 - polymer: | 14 - polymer: |
15 entry_points: web/index.html</b> | 15 entry_points: |
| 16 - web/index.html |
| 17 - web/index2.html</b> |
16 </pre> | 18 </pre> |
17 | 19 |
18 <p>A package’s assets must be in one or more of the following directories: | 20 <p>A package’s assets must be in one or more of the following directories: |
19 <code>lib</code>, <code>asset</code>, and <code>web</code>. After transformation
by <code>pub build</code>, assets are | 21 <code>lib</code>, <code>asset</code>, and <code>web</code>. After transformation
by <code>pub build</code>, assets are |
20 available under a directory called <code>build</code>. Assets generated from | 22 available under a directory called <code>build</code>. Assets generated from |
21 files in a package’s <code>lib</code> directory appear under a directory n
amed | 23 files in a package’s <code>lib</code> directory appear under a directory n
amed |
22 <code>packages/<em><pkg_name></em></code>, and those from the package&rsqu
o;s | 24 <code>packages/<em><pkg_name></em></code>, and those from the package&rsqu
o;s |
23 <code>asset</code> directory appear under <code>assets/<em><pkg_name></em>
</code>. | 25 <code>asset</code> directory appear under <code>assets/<em><pkg_name></em>
</code>. |
24 For details, see | 26 For details, see |
25 <a href="#where-to-put-assets">Where to put assets</a> and | 27 <a href="#where-to-put-assets">Where to put assets</a> and |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 173 |
172 <p>For example, consider a helloworld app’s HTML file, which is in the | 174 <p>For example, consider a helloworld app’s HTML file, which is in the |
173 helloworld directory at <code>web/helloworld.html</code>. Running <code>pub buil
d</code> produces a | 175 helloworld directory at <code>web/helloworld.html</code>. Running <code>pub buil
d</code> produces a |
174 copy at <code>build/helloworld.html</code>. In the dev server, you can get the H
TML file | 176 copy at <code>build/helloworld.html</code>. In the dev server, you can get the H
TML file |
175 contents by using the URL <code>http://localhost:8080/helloworld.html</code>.</p
> | 177 contents by using the URL <code>http://localhost:8080/helloworld.html</code>.</p
> |
176 | 178 |
177 <p>Transformers might change any part of <em><path></em>, especially the | 179 <p>Transformers might change any part of <em><path></em>, especially the |
178 filename, but they can’t change the directory structure above | 180 filename, but they can’t change the directory structure above |
179 <em><path></em>.</p> | 181 <em><path></em>.</p> |
180 | 182 |
OLD | NEW |