PC and mobile browser Sync Test Tool Browsersync Usage Introduction

Source: Internet
Author: User
Tags php server install node

In the mobile Web development, it is always inconvenient to debug, resulting in a variety of problems are not easy to find. But now with the Browsersync, everything is settled.

Unfamiliar classmates can see Browsersync's official website browsersync Chinese web.

Five-minute Quick start

1. You need to install node. js before using Browsersync. Detailed installation procedures can be found under Windows installation Nodejs

2. Install the Browsersync. Open a terminal window and run the following command:npm install -g browser-sync

3. Start Browsersync.

If you want to listen to .css files, you need to use server mode. Browsersync will start a small server and provide a URL to view your website.

First, enter the project directory of the. css file by the terminal window, and then enter the following command line:browser-sync start --server --files "css/*.css"

If you need to listen to multiple types of files, you only need to separate them with commas.

--files path is relative to the project (directory) running the command browser-sync start--server--files "css/*.css, *.html"//If your file hierarchy is deep, you may consider using * * (for any directory) match , any. css or. html file under any directory. Browser-sync start--server--files "**/*.css, **/*.html"

Just connect your phone to the same network as your PC, and use your mobile browser to scan and open your Web page for simultaneous debugging.

If you already have other on-premises server environment PHP or similar, you need to use proxy mode . Browsersync will view your site through the proxy URL (localhost:3000).

A PHP server environment is created locally, and the local server is accessed by binding browsersync.cn, using the following command, Browsersync will provide a new address, localhost : 3000来 accesses browsersync.cn and listens to all CSS files in its CSS directory.

"css/*.css"

PC and mobile browser Sync Test Tool Browsersync Usage Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.