Web Dev Workflow

basic workflow

  1. npm init

    $ cd ~/code
    $ mkdir myapp
    $ cd myapp/
    $ pwd
    /home/lee/code/myapp
    
    
    # create package.json
    $ npm init
    
  2. create folder sturcture

  3. git up

    $ vi .gitignore
    $ git init
    $ git add .
    $ git commit
    
  4. install packages

    $ npm install --save-dev gulp gulp-util
    

browser-sync

Browsersync + Gulp.js

npm init
npm install browser-sync gulp --save-dev

create a basic gulp config

var gulp        = require('gulp');
var browserSync = require('browser-sync').create();
var less        = require('gulp-less');

gulp.task('serve', [], function() {
    browserSync.init({
        files: ['*.php', '**/*.php'],   // watch these php files
        proxy: "aircon.local"
    });

    gulp.watch('*.less', [], browserSync.reload); // watch *.less files
});