Skip to content

Commit 136f5ae

Browse files
framprkostrzewski
authored andcommitted
Added docs for --template (#193)
* Added docs for --template * refactor: Remove empty defaults & fix indent in indent
1 parent ba26fc7 commit 136f5ae

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

README.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,42 +50,44 @@ npm run build
5050
```sh
5151
$ preact create
5252

53-
--name directory and package name for the new app
54-
--dest Directory to create the app within [default: <name>]
55-
--type A project template to start from
53+
--name directory and package name for the new app.
54+
--dest Directory to create the app within. [default: <name>]
55+
--type A project template to start from.
5656
[Options: "default", "root", "simple", "empty"] [default: "default"]
57-
--less Pre-install LESS support [boolean] [default: false]
58-
--sass Pre-install SASS/SCSS support [boolean] [default: false]
59-
--git Initialize version control using git [boolean] [default: true]
57+
--less Pre-install LESS support. [boolean] [default: false]
58+
--sass Pre-install SASS/SCSS support. [boolean] [default: false]
59+
--git Initialize version control using git. [boolean] [default: true]
6060

6161
$ preact build
6262

63-
--src Entry file (index.js) [default: "src"]
64-
--dest Directory root for output [default: "build"]
63+
--src Entry file (index.js). [default: "src"]
64+
--dest Directory root for output. [default: "build"]
6565
--production, -p Create a minified production build. [default: true]
66-
--less, -l Build and compile LESS files [default: false]
67-
--sass, -s Build and compile SASS files [default: false]
66+
--less, -l Build and compile LESS files. [default: false]
67+
--sass, -s Build and compile SASS files. [default: false]
6868
--prerender Pre-render static app content. [default: true]
69+
--template Path to template file.
6970
--clean Clear output directory before building. [default: true]
7071
--json Generate build statistics for analysis. [default: false]
7172
--config, -c Path to custom CLI config.
7273

7374
$ preact watch
7475

75-
--src Entry file (index.js) [default: "src"]
76-
--port, -p Port to start a server on [default: "8080"]
76+
--src Entry file (index.js). [default: "src"]
77+
--port, -p Port to start a server on. [default: "8080"]
7778
--host [boolean] [default: "0.0.0.0"]
78-
--prerender Pre-render static app content on initial build [default: false]
79+
--prerender Pre-render static app content on initial build. [default: false]
80+
--template Path to template file.
7981

8082
$ preact serve
8183

8284
--dir Directory root to serve static files from. [default: "build"]
8385
--cwd The working directory in which to spawn a server. [default: .]
8486
--server Which server to run, or "config" to produce a firebase config.
8587
[options: "simplehttp2server", "superstatic", "config"] [default:"simplehttp2server"]
86-
--dest Directory or filename where firebase.json should be written
88+
--dest Directory or filename where firebase.json should be written.
8789
(used for --server config) [default: -]
88-
--port, -p Port to start a server on [default: "8080"]
90+
--port, -p Port to start a server on. [default: "8080"]
8991

9092
```
9193

@@ -142,6 +144,18 @@ export default function (config, env, helpers) {
142144
```
143145
See [WebpackConfigHelpers] docs for more info on ```helpers``` argument.
144146

147+
#### Template
148+
A template is used to render your page.
149+
150+
The default one is visible [here](src/resources/template.html) and it's going to be enough for the majority of cases.
151+
152+
If you want to customise your template you can pass a custom template with the `--template` flag.
153+
154+
The `--template` flag is available on the `build` and `watch` commands.
155+
```
156+
preact build --template src/template.html
157+
preact watch --template src/template.html
158+
```
145159

146160
[preact]: https://github.com/developit/preact
147161
[preact-router]: https://github.com/developit/preact-router

0 commit comments

Comments
 (0)