Files
tldr/pages.zh/common/browser-sync.md
2020-11-04 17:12:56 -03:00

21 lines
554 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# browser-sync
> 启动一个本地的服务,可以监听文件改动,刷新浏览器.
> 更多信息: <https://browsersync.io/docs/command-line>.
- 将指定目录发成服务:
`browser-sync start --server {{路径/到/目录}} --files {{路径/到/目录}}`
- 启动当前目录服务同时监听指定目录下css文件的变动
`browser-sync start --server --files '{{路径/到/目录/*.css}}'`
- 创建配置文件:
`browser-sync init`
- 按指定配置文件中的配置启动服务:
`browser-sync start --config {{配置文件}}`