LoginSignup
1
0

More than 3 years have passed since last update.

リモートサーバーなんだけどbrowser-syncでCSSをstream更新したい

Posted at

動機

ローカルでWordPressなどの環境を作るのが面倒なので、サーバーはリモートのサーバーを使いたい。
CSS(SCSS)の編集はローカルでgulpを使用して行うが、変更内容はブラウザをリロードすることなくstreamで反映して欲しい。

実装

大事な部分だけ。
CSSの更新をstream反映するコードのサンプルはよそにいっぱいあるので省略。
Basic認証とかかかっていてもこれで大丈夫。

  browserSync({
    proxy: 'http://your.external.server',
    serveStatic: [{
      route: '/wp-content/themes/mytheme/assets/css',
      dir: 'assets/css'
    }],
  })
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0