BrowserSync,自動刷新,解放F5,去掉更新提示

  BrowserSync雖然這個技術不算新,可是依然有用。略微介紹下css

  沒有安裝node,先安裝node,這裏再也不作介紹html

  安裝node

    npm install -g browser-sync  全局安裝,方便在任意目錄下啓動npm

  所在項目中啓動瀏覽器

    browser-sync start --server --files "**"  全部文件都檢測改變刷新,並自動打開瀏覽器spa

    http://localhost:3000/ 至關於你的index.html文件,若是你的html文件夾下有個db.html,那麼地址就是 http://localhost:3000/html/db.htmlserver

  去掉更新成功的 Connected to BrowserSync 提示htm

    其實這是browser-sync-client.js 動態生成的一個div,id名叫 __bs_notify__ ,那咱們直接在在一個公共的css文件下加上如下樣式代碼便可去掉提示   import

         #__bs_notify__{          display: none!important;      }
相關文章
相關標籤/搜索