1 | # The Batfish CLI
|
2 |
|
3 | The following is output by `batfish --help`:
|
4 |
|
5 | ```
|
6 | Build websites with batfish.
|
7 |
|
8 | Usage
|
9 | batfish <command> [options]
|
10 |
|
11 | You must provide a batfish configuration module, either with
|
12 | batish.config.js in process.cwd() or with the --config option.
|
13 |
|
14 | Commands
|
15 | start Start a development server.
|
16 | build Build the static site.
|
17 | serve-static Serve the static site.
|
18 | write-babelrc Write a .babelrc file that other processes,
|
19 | like your test runner, can use.
|
20 |
|
21 | Shared options
|
22 | -c, --config Path to your configuration module.
|
23 | Default: batfish.config.js
|
24 | -V, --verbose Log extra stats.
|
25 |
|
26 | start options
|
27 | -p, --port Server port. Default: 8080.
|
28 | -i, --include Build only the specified page(s). Value
|
29 | is a glob relative to the root of your site.
|
30 | --production Build as though for production.
|
31 | --no-clear Do not clear the destination directory.
|
32 | -b, --browsers A comma-separated browserslist string
|
33 | specifying the browsers you want to support
|
34 | during this dev build. Or "false" if you
|
35 | want to support all your production browsers.
|
36 |
|
37 | build options
|
38 | -d, --debug Build for debugging, not for production.
|
39 | --no-clear Do not clear the destination directory.
|
40 | -s, --stats Generate Webpack statistics.
|
41 |
|
42 | serve-static options
|
43 | -p, --port Server port. Default: 8080.
|
44 |
|
45 | write-babelrc options
|
46 | --target "node" or "browser". Default: "node".
|
47 | --dir Directory where .babelrc should be written.
|
48 | Default: same directory as Batfish config.
|
49 |
|
50 | Examples
|
51 | No options are required for any command.
|
52 | batfish start
|
53 | batfish build
|
54 | batfish serve-static
|
55 | batfish write-babelrc
|
56 | Build with your Batfish config in a special place.
|
57 | batfish build -c conf/bf.js
|
58 | Start with an alternate port.
|
59 | batfish start -p 9966
|
60 | Start but only build the /about pages.
|
61 | batfish start -i about/**
|
62 | Start but only build the /about/history page.
|
63 | batfish start --include about/history
|
64 | Start and build only for Chrome 60+.
|
65 | batfish start --browsers "Chrome >= 60"
|
66 | ```
|