Skip to content

Instantly share code, notes, and snippets.

@mocon
Created February 16, 2018 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mocon/f9d4dec15c1d9d05f962ff5832cfcaed to your computer and use it in GitHub Desktop.
Save mocon/f9d4dec15c1d9d05f962ff5832cfcaed to your computer and use it in GitHub Desktop.
Simple `browser-sync` setup
{
"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"
}
}
@mocon
Copy link
Author

mocon commented Feb 27, 2018

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 run yarn start to start a live-reloading server that watches all .html, .css, & .js files and refreshes automatically when you save files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment