1 | ## var files = build.files(nodes, [options])
|
2 |
|
3 | This is the simplest builder. This just iterates through all the files you choose and allows you to do whatever you wish with them. `.end()`'s callback doesn't return anything.
|
4 |
|
5 | Known limitiations:
|
6 |
|
7 | - This builder does __not__ handle symlinks.
|
8 |
|
9 | ## Plugins
|
10 |
|
11 | Note that these two following plugins are unnecessary in development if you serve from both "components/" and ".". These plugins simply rewrite files to `build/` based on your apps directories.
|
12 |
|
13 | For example, doing the following in development would make the file builder unnecessary:
|
14 |
|
15 | ```js
|
16 | var app = require('express')();
|
17 | var static = require('serve-static');
|
18 |
|
19 | // serve your dependencies
|
20 | app.use(static(__dirname + '/components'));
|
21 |
|
22 | // serve your entire app
|
23 | app.use(static(__dirname));
|
24 | ```
|
25 |
|
26 | ### copy()
|
27 |
|
28 | Copies each file to the destination with the directory `<user>/<repo>/<version>`. You probably want to use this when creating a production build.
|
29 |
|
30 | ```js
|
31 | build.files()
|
32 | .use('images', builder.plugins.copy())
|
33 | ```
|
34 |
|
35 | ### symlink()
|
36 |
|
37 | Very similar to `copy()`, but symlinks (or "creates shortcuts") instead. This is faster during development. Note that this will only work on UNIX-like systems.
|
38 |
|
39 | ```js
|
40 | build.files()
|
41 | .use('images', builder.plugins.symlink())
|
42 | ```
|