tldr/pages.zh/common/browser-sync.md

21 lines
554 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 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 {{配置文件}}`