Skip to content

Commit 32635cf

Browse files
committed
feat: 🎸 添加针对 preview 命令的新功能说明
1 parent 8aad44e commit 32635cf

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/cli/commands.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,28 @@ You can configure the service port using the `--port` parameter.
337337
338338
```bash
339339
$ win preview --port 9527
340+
341+
# specify hostname
342+
win preview --host [host]
343+
344+
# specify port
345+
win preview --port [port]
346+
347+
# specify build directory
348+
win preview --dir [dir]
349+
350+
# specify url prefix
351+
win preview --prefix [prefix]
352+
353+
# access path: http://localhost:4172/boilerplate
340354
```
341355
342356
Now the `preview` command will run the server at http://127.0.0.1:9527.
343357
344358
Use the `--host` parameter to specify the hostname for the service.
359+
Use the `--port` parameter to specify the port for the service.
360+
Use the `--dir` parameter to specify the build output directory, defaults to dist.
361+
Use the `--prefix` parameter to allow custom URL prefix, defaults to `base` in the configuration file.
345362
346363
The following user configurations will also take effect during `preview`:
347364

src/zh/cli/commands.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,28 @@ $ win plugin list
337337
338338
```bash
339339
$ win preview --port 9527
340+
341+
# specify hostname
342+
win preview --host [host]
343+
344+
# specify port
345+
win preview --port [port]
346+
347+
# specify build directory
348+
win preview --dir [dir]
349+
350+
# specify url prefix
351+
win preview --prefix [prefix]
352+
353+
# access path:http://localhost:4172/boilerplate
340354
```
341355
342356
现在 `preview` 命令会将服务器运行在 http://127.0.0.1:9527.
343357
344358
通过 `--host` 参数来指定 配置服务运行的 hostname。
359+
通过 `--port` 参数来指定 配置服务运行的 port。
360+
通过 `--dir` 参数来指定构建后的输出目录,默认为 dist。
361+
通过 `--prefix` 参数来允许自定义 URL 前缀,默认为配置文件里的 `base`
345362
346363
以下用户配置在 `preview` 时也会生效
347364

0 commit comments

Comments
 (0)