使用browsersync 達到跨瀏覽器、平台同步顯示
1.安裝node.js

2.在terminal輸入,安裝browsersync
npm install -g browser-sync


3.如果要讓ipad和電腦同步,先都連到同一wifi上
輸入
browser-sync start --proxy "測試網址" --files "css/*.css, *.html"

4.得到
C:\Users\user>browser-sync start --proxy "https://www.ncc.gov.tw" --files "css/*.css, *.html"
[Browsersync] Proxying: https://www.ncc.gov.tw
[Browsersync] Access URLs:
 --------------------------------------
       Local: https://localhost:3000
    External: https://192.168.56.1:3000
 --------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.56.1:3001
 --------------------------------------
[Browsersync] Watching files...

並自動跳出默認瀏覽器進入他給的local url (在這裡是 https://localhost:3000)

5.若使用mac則chrome和safari都瀏覽 https://localhost:3000 即可
若使用ipad+電腦,電腦端瀏覽 local url ,ipad瀏覽 external url (https://192.168.56.1:3000)

測試畫面:


source: