Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save barbagrigia/eaf9dc85ea0177774a0fd1c96b390387 to your computer and use it in GitHub Desktop.
Save barbagrigia/eaf9dc85ea0177774a0fd1c96b390387 to your computer and use it in GitHub Desktop.
harp + browsers-sync, start developing for the web in under a minute (probably ;) )

What is this combo?

Static file server with livereload, preprocessors, synchronised testing over multiple browser instances and batteries included. This setup uses Harp and Browsersync, hence the name.

Prerequisite

You will need node, install it if you haven't already.

Init all the things

Run the following command (replace myproject with anything you want):

npm init myproject && cd myproject && npm init

Enter through the questionnaire, fill in what you want :).

More commandments

npm i -D harp browser-sync

This will take a while, lots of deps you know.

After that, open that minty package.json file in you favorite editor and add the following to the "scripts" property:

"dev": "harp server & browser-sync start --proxy 'localhost:9000' --files '**/*.coffee, **/*.jade, **/*.scss'"

Adjust the files argument to your liking obviously.

Run the puppy

npm run dev

Happy coding!

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