Created
February 16, 2018 18:26
-
-
Save mocon/f9d4dec15c1d9d05f962ff5832cfcaed to your computer and use it in GitHub Desktop.
Simple `browser-sync` setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "example", | |
"version": "0.1.0", | |
"main": "index.js", | |
"license": "UNLICENSED", | |
"dependencies": { | |
"browser-sync": "2.23.6" | |
}, | |
"scripts": { | |
"start": "browser-sync start --server --files '**/*.css, **/*.html, **/*.js' --directory --port 7777", | |
"clean": "rm -r node_modules && yarn cache clean && yarn" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First, install Node.js & Yarn.
Create a folder for your project, and paste the contents above into a new file called
package.json
. Then, open up a Terminal, change to your project folder directory, and runyarn start
to start a live-reloading server that watches all .html, .css, & .js files and refreshes automatically when you save files.