var gulp       = require('gulp'),
    sass       = require('gulp-sass'),
    prefix     = require('gulp-autoprefixer'),
    livereload = require('gulp-livereload');


gulp.task('theme', function() {

  return gulp.src('zinnia/static/zinnia/theme/sass/**/*.scss')
         .pipe(sass({errLogToConsole: true}))
         .pipe(prefix())
         .pipe(gulp.dest('zinnia/static/zinnia/theme/css'));
});

gulp.task('admin-dashboard', function() {

  return gulp.src('zinnia/static/zinnia/admin/dashboard/sass/*.scss')
         .pipe(sass({errLogToConsole: true}))
         .pipe(prefix())
         .pipe(gulp.dest('zinnia/static/zinnia/admin/dashboard/css'));
});

gulp.task('watch', function() {

  livereload.listen();

  gulp.watch(['zinnia/static/zinnia/**/*',
              'zinnia/templates/**/*']).on('change', livereload.changed);

  gulp.watch('zinnia/static/zinnia/theme/sass/**/*.scss', ['theme']);
  gulp.watch('zinnia/static/zinnia/admin/dashboard/sass/*.scss', ['admin-dashboard']);

});


gulp.task('default', ['theme', 'admin-dashboard', 'watch']);

@@ -1,18 +1,19 @@
 var 
-gulp      
+browserSync
  = r
@@ -24,24 +24,42 @@
 re('
-gulp'
+browser-sync').create(
 ),%0A    
-sass
+gulp 
     
@@ -80,13 +80,8 @@
 gulp
--sass
 '),%0A
@@ -91,24 +91,25 @@
  prefix     
+ 
 = require('g
@@ -136,190 +136,465 @@
     
-livereload = require('gulp-livereload');%0A%0A%0Agulp.task('theme', function() %7B%0A%0A  return gulp.src('zinnia/static/zinnia/theme/sass/**/*.scss')%0A         .pipe(sass(%7BerrLogToConsole: true%7D
+sass        = require('gulp-sass'),%0A    sourcemaps  = require('gulp-sourcemaps');%0A%0Avar HTML       = 'zinnia/templates/**/*.html',%0A    THEME      = 'zinnia/static/zinnia/theme/sass/**/*.scss',%0A    DASHBOARD  = 'zinnia/static/zinnia/admin/dashboard/sass/*.scss';%0A%0Agulp.task('theme', function() %7B%0A  browserSync.notify('Compiling theme, please wait !');%0A%0A  return gulp.src(THEME)%0A         .pipe(sourcemaps.init())%0A         .pipe(sass().on('error', sass.logError
 ))%0A 
@@ -609,32 +609,67 @@
 .pipe(prefix())%0A
+         .pipe(sourcemaps.write())%0A
          .pipe(g
@@ -707,24 +707,61 @@
 theme/css'))
+%0A         .pipe(browserSync.stream())
 ;%0A%7D);%0A%0Agulp.
@@ -766,22 +766,16 @@
 p.task('
-admin-
 dashboar
@@ -795,122 +795,179 @@
 ) %7B%0A
-%0A
   
-return gulp.src('zinnia/static/zinnia/admin/dashboard/sass/*.scss')%0A         .pipe(sass(%7BerrLogToConsole: true%7D
+browserSync.notify('Compiling dashboard, please wait !');%0A%0A  return gulp.src(DASHBOARD)%0A         .pipe(sourcemaps.init())%0A         .pipe(sass().on('error', sass.logError
 ))%0A 
@@ -982,32 +982,67 @@
 .pipe(prefix())%0A
+         .pipe(sourcemaps.write())%0A
          .pipe(g
@@ -1094,16 +1094,53 @@
 d/css'))
+%0A         .pipe(browserSync.stream())
 ;%0A%7D);%0A%0Ag
@@ -1149,21 +1149,21 @@
 p.task('
-watch
+serve
 ', funct
@@ -1177,148 +1177,159 @@
 %0A%0A  
-livereload.listen();%0A%0A  gulp.watch(%5B'zinnia/static/zinnia/**/*',%0A              'zinnia/templates/**/*'%5D).on('change', livereload.change
+browserSync.init(%7B%0A        proxy: 'localhost:8000',%0A        serveStatic: %5B'zinnia/static'%5D%0A  %7D);%0A%0A  gulp.watch(HTML).on('change', browserSync.reloa
 d);%0A
-%0A
   gu
@@ -1341,138 +1341,53 @@
 tch(
-'zinnia/static/zinnia/theme/sass/**/*.scss', %5B'theme'%5D);%0A  gulp.watch('zinnia/static/zinnia/admin/dashboard/sass/*.scss', %5B'admin-
+THEME, %5B'theme'%5D);%0A  gulp.watch(DASHBOARD, %5B'
 dash
@@ -1402,17 +1402,16 @@
 ;%0A%0A%7D);%0A%0A
-%0A
 gulp.tas
@@ -1429,42 +1429,13 @@
 , %5B'
-theme', 'admin-dashboard', 'watch
+serve
 '%5D);
-%0A

Refactor gulpfile to handle sourcemaps and browserSync