Fixed Sass workflow in generator
diff --git a/views/ngXosLib/generator-xos/app/templates/gulp/build.js b/views/ngXosLib/generator-xos/app/templates/gulp/build.js
index 2861020..663a4cf 100644
--- a/views/ngXosLib/generator-xos/app/templates/gulp/build.js
+++ b/views/ngXosLib/generator-xos/app/templates/gulp/build.js
@@ -22,6 +22,10 @@
 var inject = require('gulp-inject');
 var rename = require('gulp-rename');
 var replace = require('gulp-replace');
+var postcss = require('gulp-postcss');
+var autoprefixer = require('autoprefixer');
+var mqpacker = require('css-mqpacker');
+var csswring = require('csswring');
 
 const TEMPLATE_FOOTER = `
 angular.module('xos.<%= name %>')
@@ -35,25 +39,14 @@
   // delete previous builded file
   gulp.task('clean', function(){
     return del(
-      [options.dashboards + 'xos<%= fileName %>.html'],
+      [
+        options.dashboards + 'xos<%= fileName %>.html',
+        options.static + 'css/xos<%= fileName %>.css'
+      ],
       {force: true}
     );
   });
 
-  // inject CSS
-  gulp.task('injectCss', function(){
-    return gulp.src(options.src + 'index.html')
-      .pipe(
-        inject(
-          gulp.src(options.src + 'css/*.css'),
-          {
-            ignorePath: [options.src]
-          }
-          )
-        )
-      .pipe(gulp.dest(options.src));
-  });
-
   // minify css
   gulp.task('css', function () {
     var processors = [
@@ -71,7 +64,7 @@
   });
 
   // copy css in correct folder
-  gulp.task('copyCss', ['css'], function(){
+  gulp.task('copyCss', ['wait'], function(){
     return gulp.src([`${options.tmp}/css/*.css`])
     .pipe(concat('xos<%= fileName %>.css'))
     .pipe(gulp.dest(options.static + 'css/'))
@@ -102,7 +95,7 @@
   });
 
   // copy html index to Django Folder
-  gulp.task('copyHtml', ['clean'], function(){
+  gulp.task('copyHtml', function(){
     return gulp.src(options.src + 'index.html')
       // remove dev dependencies from html
       .pipe(replace(/<!-- bower:css -->(\n.*)*\n<!-- endbower --><!-- endcss -->/, ''))
@@ -112,7 +105,8 @@
         inject(
           gulp.src([
             options.static + 'js/vendor/xos<%= fileName %>Vendor.js',
-            options.static + 'js/xos<%= fileName %>.js'
+            options.static + 'js/xos<%= fileName %>.js',
+            options.static + 'css/xos<%= fileName %>.css'
           ]),
           {ignorePath: '/../../../xos/core/xoslib'}
         )
@@ -146,13 +140,22 @@
       .pipe(eslint.failAfterError());
   });
 
+  gulp.task('wait', function (cb) {
+    // setTimeout could be any async task
+    setTimeout(function () {
+      cb();
+    }, 1000);
+  });
+
   gulp.task('build', function() {
     runSequence(
+      'clean',
       'templates',
       'babel',
       'scripts',
       'wiredep',
-      'injectCss',
+      'css',
+      'copyCss',
       'copyHtml',
       'cleanTmp'
     );