Install Gulp globally (if not already installed), run the following commands from the terminal/command prompt:
$ npm install gulp -g
Navigate to the project directory, run npm init to setup the project, answer the questions when prompted:
$ npm init
Install Gulp to the project:
$ npm install gulp --save-dev
Install BrowserSync:
$ npm install -g browser-sync
Create the file gulpfile.js, enter the below snippet and save.
Run 'gulp' from the terminal.
Example below assumes this project hierarchy, all files within their own directory, output assets are sub-direectories of 'dist':
./
gulpfile.js
index.html
package.json
package-lock.json
/dist
/css
main.css
/js
main.min.js
/js
main.js
/node_modules
/sass
main.sass
Customise the files being watched as needed in gulpfile.js, e.g. gulp.watch('*.php', browserSync.reload);