     .pipe gulpLess {paths: lessPaths}
     .pipe gulp.dest './target/client/tmp/app/css/'
 
+
 gulp.task 'vendors', () ->
-  bowerStream = gulp.src(mainBowerFiles()).pipe(gulpIgnore.exclude('bower_components/bootstrap/**/*.*'))
+  bowerStream = gulp.src(mainBowerFiles(), {base: 'bower_components'}).pipe(gulpIgnore.exclude('bower_components/bootstrap/**/*.*'))
   es.merge(
     bowerStream.pipe(gulpFilter('**/*.css'))
-      .pipe(gulpConcat('vendors.css'))
       .pipe(gulp.dest('./target/client/tmp/vendors/css'))
     bowerStream.pipe(gulpFilter('**/*.js'))
-      .pipe(gulpConcat('vendors.js'))
       .pipe(gulp.dest('./target/client/tmp/vendors/js')))
 
+
 index = () ->
-  opt = {read: false}
-  cssSortFunction = (a, b) ->
-    if a.path.endsWith('/bootstrap.css')
-      -1
-    else if b.path.endsWith('/bootstrap.css')
-      1
-    else
-      a.path.localeCompare(b.path)
+  bowerStream = gulp.src(mainBowerFiles(), {base: 'bower_components', read: false})
+    
+  cssVendorFiles = bowerStream
+    .pipe(gulpIgnore.exclude('bower_components/bootstrap/**/*.*'))
+    .pipe(gulpFilter('**/*.css'))
+    .pipe(gulp.dest('./vendors/css'))
+
+  jsVendorFiles = bowerStream
+    .pipe(gulpFilter('**/*.js'))
+    .pipe(gulp.dest('./vendors/js'))
 
   gulp.src('./src/main/client/index.html')
-    .pipe(gulpInject(es.merge(appVendorFiles(), cssVendorFiles(opt).pipe(sort(cssSortFunction))), {ignorePath: ['target/client/tmp'], starttag: '<!-- inject:vendor:{{ext}} -->'}))
-    .pipe(gulpInject(es.merge(appFiles(), cssFiles(opt).pipe(sort(cssSortFunction))), {ignorePath: ['target/client/tmp', 'src/main/client']}))
+    .pipe(gulpInject(gulp.src('./target/client/tmp/vendors/css/bootstrap.css'), {ignorePath: ['target/client/tmp'], starttag: '<!-- inject:bootstrap:{{ext}} -->'}))
+    .pipe(gulpInject(es.merge(jsVendorFiles, cssVendorFiles), {ignorePath: ['target/client/tmp'], starttag: '<!-- inject:vendor:{{ext}} -->'}))
+    .pipe(gulpInject(es.merge(appFiles(), cssFiles()), {ignorePath: ['target/client/tmp', 'src/main/client']}))
     .pipe(gulp.dest('./target/client/tmp/'))
+    
     
 gulp.task 'templates', () ->
   templateFiles({min: true}).pipe(buildTemplates())
   
+  
 gulp.task 'assets', () ->
   gulp.src './src/main/client/assets/statics/**'
     .pipe gulp.dest './target/client/tmp/statics'
+  
   
 buildTemplates = () ->
   lazypipe()

      .pipe gulp.dest('./target/client/tmp/app/statics/fonts')
  )

gulp.task 'clean-css', (cb) ->
  del './target/client/tmp/app.css/app.css', cb

gulp.task 'styles', ['clean-css'], () ->
  lessPaths = [


compareStrings = (a, b) -> if a < b then -1 else if a > b then 1 else 0


gulp.task 'coffee', () ->
  gulp.src ['./src/main/client/**/*.*coffee']
    .pipe gulpCoffee()
    .pipe gulp.dest('./target/client/tmp/app/js')


gulp.task 'bootstrap', () ->
  bootstrapStream = gulp.src('src/main/client/less/custom-bootstrap.less')
