 ###
 
 gulp.task 'js_dev_main', ->
-    gulp.src('./source/js/[^-]*.coffee')
+    gulp.src(config.js.src.main)
         .pipe(plumber())
         .pipe(includeFile())
         .pipe(coffee())
-        .pipe(gulp.dest('./app/frontend/js'))
+        .pipe(gulp.dest(config.js.dest.main))
         .pipe(reload(stream: true))
 
 gulp.task 'js_dev_lib', ->
-    gulp.src('./source/js/lib/[^-]*.js')
-        .pipe(gulp.dest('./app/frontend/js/lib/'))
+    gulp.src(config.js.src.lib)
+    .pipe(gulp.dest(config.js.dest.lib))
         .pipe(reload(stream: true))
 
 gulp.task 'js_dev', sequence(

###

gulp.task 'styleguide', ->
    gulp.src('./source/styl/[^-]*.styl')
        .pipe(plumber())
        .pipe(stylus())
        .pipe(styledown(
            config: './source/docs/config.styl'
            filename: 'index.html'
        ))
        .pipe(gulp.dest('./app/docs/'))
        .pipe(reload(stream: true))




# Cледим за изменениями
gulp.task 'watch', ->
    watch config.style.watch, ->
        gulp.start ['stylus_dev', 'styleguide']
        return
    watch config.tpl.watch, ->
        gulp.start ['jade_dev']
        return
    watch config.js.watch, ->
        gulp.start ['js_dev_main', 'js_dev_lib']
        return
    watch config.img.watch, ->
        gulp.start ['img_dev']
        return
    return
