前提・実現したいこと
browser-syncを用いて自動リロードされるようにしたいです。
発生している問題・エラーメッセージ
ドキュメント等を見ながら実装してみましたが、コンパイル後に変更の検知はされるのですがリロードされません。
$ browser-sync start --config bs-config.js [Browsersync] Access URLs: ------------------------------------------- Local: http://localhost:8000/top External: http://xxx.xxx.xxx.xxx:8000/top ------------------------------------------- UI: http://localhost:3001 UI External: http://xxx.xxx.xxx.xxx:3001 ------------------------------------------- [Browsersync] Serving files from: ./public [Browsersync] Watching files... [Browsersync] File event [change] : public/static/css/xxxxx.css
該当のソースコード
js
1// bs-config.js 2module.exports = { 3 "files": [ 4 "./public" 5 ], 6 "server": { 7 "baseDir": "./public" 8 }, 9 "proxy":false, 10 "port": 8000, 11 "startPath": "/top", 12}
ディレクトリ構成
app
├ src
├ resources
│ └ views
│ └ xxx.blade.php
├ public
│ ├ index.php
│ └ static
│ ├ js
│ └ css
├ package.json
├ bs-config.js
└ webpack.config.js
試したこと
bs-configのproxyを localhost:8000
等にしてみましたが、うまくいきませんでした。
補足情報(FW/ツールのバージョンなど)
php -S localhost:8000 -t public/
json
1// package.json 2{ 3 "scripts": { 4 "_watch:build": "webpack -d --watch --progress --colors &", 5 "_watch:proxy": "browser-sync start --config bs-config.js", 6 "watch": "run-s _watch:*", 7 }, 8 "devDependencies": { 9 "browser-sync": "^2.24.7", 10 }, 11}
いろいろ設定の変更等試してみましたが、うまくいきません。
私の設定がおかしいのだろうと思うのですが、分からず、、、どなたかご教授お願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。