// Build GeoDash.js

var gulp = require('gulp')
  , rename = require('gulp-rename')
  , concat = require('gulp-concat')
  , uglify = require('gulp-uglify')
  , less = require('gulp-less')

var gulpconcat = function(){
  gulp.src(['src/lib/*.js', '!src/lib/ezoop.js', 'dist/geodash.min.js'])
    .pipe(concat('geodash.min.js'))
    .pipe(gulp.dest('../dist'))

  gulp.src(['src/lib/*.js', '!src/lib/ezoop.js', 'dist/geodash.js'])
    .pipe(concat('geodash.js'))
    .pipe(gulp.dest('dist'))
}

gulp.task('minify', function(next){
  gulp.src(['src/lib/ezoop.js', 'src/GeoDash.js', 'src/Chart.js', 'src/charts/*.js'])
    .pipe(concat('geodash.js'))
    .pipe(gulp.dest('../dist'))
    .pipe(rename('geodash.min.js'))
    .pipe(uglify())
    .pipe(gulp.dest('../dist'))
    .on('end', next)
})

gulp.task('less', function () {
  gulp.src('src/styles/chart.less')
    .pipe(less({
      paths: ['../src/Styles']
    }))
    .pipe(rename('geodash.min.css'))
    .pipe(gulp.dest('../dist'))
})

gulp.task('default', function() {
  gulp.run('minify', function() { gulpconcat() })
  gulp.run('less')

  gulp.watch(['src/GeoDash.js', 'src/Chart.js', 'src/charts/*.js'], function(event) {
    gulp.run('minify', function() { gulpconcat() })
  })

  gulp.watch(['src/styles/*.less'], function(event) {
    gulp.run('less', function() { gulpconcat() })
  })

})
@@ -186,24 +186,25 @@
 ')%0A%0A
-var gulpconcat =
+gulp.task('less',
  fun
@@ -208,18 +208,20 @@
 function
+ 
 ()
+ 
 %7B%0A  gulp
@@ -229,68 +229,31 @@
 src(
-%5B
 'src/
-lib/*.js', '!src/lib/ezoop.js', 'dist/geodash.min.j
+styles/chart.les
 s'
-%5D
 )%0A  
@@ -264,134 +264,52 @@
 ipe(
-concat('geodash.min.js'))%0A    .pipe(gulp.dest('../dist'))%0A%0A  gulp.src(%5B'src/lib/*.js', '!src/lib/ezoop.js', 'dist/geodash.js'%5D
+less(%7B%0A      paths: %5B'../src/Styles'%5D%0A    %7D)
 )%0A  
@@ -308,38 +308,38 @@
   %7D))%0A    .pipe(
-concat
+rename
 ('geodash.js'))%0A
@@ -324,33 +324,38 @@
 rename('geodash.
-j
+min.cs
 s'))%0A    .pipe(g
@@ -364,16 +364,19 @@
 p.dest('
+../
 dist'))%0A
@@ -376,16 +376,17 @@
 ist'))%0A%7D
+)
 %0A%0Agulp.t
@@ -678,33 +678,32 @@
 xt)%0A%7D)%0A%0A
-gulp.task('less',
+var gulpconcat =
  functio
@@ -695,36 +695,34 @@
 oncat = function
- 
 ()
- 
 %7B%0A  gulp.src('sr
@@ -722,32 +722,105 @@
 src(
+%5B
 'src/
-styles/chart.les
+lib/*.js', '!src/lib/ezoop.js', 'dist/geodash.min.js'%5D)%0A    .pipe(concat('geodash.min.j
 s')
+)
 %0A   
@@ -830,52 +830,98 @@
 ipe(
-less(%7B%0A      paths: %5B'../src/Styles'%5D%0A    %7D)
+gulp.dest('../dist'))%0A%0A  gulp.src(%5B'src/lib/*.js', '!src/lib/ezoop.js', 'dist/geodash.js'%5D
 )%0A  
@@ -920,38 +920,38 @@
 js'%5D)%0A    .pipe(
-rename
+concat
 ('geodash.min.cs
@@ -936,38 +936,33 @@
 concat('geodash.
-min.cs
+j
 s'))%0A    .pipe(g
@@ -963,35 +963,32 @@
 pipe(gulp.dest('
-../
 dist'))%0A%7D)%0A%0Agulp
@@ -972,33 +972,32 @@
 .dest('dist'))%0A%7D
-)
 %0A%0Agulp.task('def
@@ -1339,11 +1339,10 @@
 %7D)%0A  %7D)%0A
-%0A
 %7D)

update gulpfile