Skip to content

Instantly share code, notes, and snippets.

@tomothumb
Last active December 1, 2016 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomothumb/bf2c29873a9deddf055b3ceac72caccf to your computer and use it in GitHub Desktop.
Save tomothumb/bf2c29873a9deddf055b3ceac72caccf to your computer and use it in GitHub Desktop.
Browsersyncでファイルwatchして再読み込み
# 127.0.0.1:8000がファイルが変更されたタイミングで再読み込みされる例
# 重たくなるので、監視対象は少ない方が良いっぽい。
#HTMLファイルだけ監視
$ browser-sync start --proxy "127.0.0.1:8000" --files="./**/*.hfml"
#CSSファイルだけ監視
$ browser-sync start --proxy "127.0.0.1:8000" --files="./**/*.css"
#複数の拡張子(ここではPHP、CSS、JS、HTML)を監視。
$ browser-sync start --proxy "127.0.0.1:8000" --files="./**/*.php,./**/*.css,./**/*.js/,./**/*.html"
# 特定のドメインと連携する場合は次のような感じ。ポート省略すると80番
$ browser-sync start --proxy "example.com" --files="./**/*.hfml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment