'use strict';

var path = require('path');

var stylesTask = function (gulp, plugins, config, helpers) {

  gulp.task('styles-watch', function() {
    return gulp.src(path.join(config.src.base, config.src.stylesMain))
      .pipe(plugins.sourcemaps.init())
      .pipe(plugins.plumber(helpers.onError))
      .pipe(plugins.sassGlob())
      .pipe(plugins.sass({ outputStyle: 'expanded', includePaths: ['node_modules'] }))
      .pipe(plugins.sourcemaps.write('./'))
      .pipe(gulp.dest(path.join(config.dest.base, config.dest.styles)))
      .pipe(plugins.browserSync.stream({ match: '**/*.css' }));
  });

  gulp.task('styles-build', ['assets-build', 'lint-css'], function() {

    var postcssPlugins = [
      require('autoprefixer')()
    ];

    return gulp.src(path.join(config.src.base, config.src.stylesMain))
      .pipe(plugins.sourcemaps.init())
      .pipe(plugins.plumber(helpers.onError))
      .pipe(plugins.sassGlob())
      .pipe(plugins.sass({ outputStyle: 'expanded', includePaths: ['node_modules'] }))
      .pipe(plugins.postcss(postcssPlugins))
      .pipe(plugins.cleanCss())
      .pipe(plugins.sourcemaps.write('./'))
      .pipe(plugins.rev())
      .pipe(plugins.revReplace())
      .pipe(gulp.dest(path.join(config.dest.base, config.dest.styles)))
      .pipe(plugins.rev.manifest({
        path: path.join(config.dest.base, config.dest.revManifest),
        base: config.dest.base,
        merge: true
      }))
      .pipe(gulp.dest(config.dest.base))
      .pipe(plugins.browserSync.stream());
  });
};

module.exports = stylesTask;

@@ -99,16 +99,77 @@
 ers) %7B%0A%0A
+  var postcssPlugins = %5B%0A    require('autoprefixer')()%0A  %5D;%0A%0A
   gulp.t
@@ -201,16 +201,16 @@
 ion() %7B%0A
-
     retu
@@ -468,32 +468,77 @@
 e_modules'%5D %7D))%0A
+      .pipe(plugins.postcss(postcssPlugins))%0A
       .pipe(plug
@@ -708,16 +708,16 @@
 %0A  %7D);%0A%0A
+
   gulp.t
@@ -783,76 +783,8 @@
 ) %7B%0A
-%0A    var postcssPlugins = %5B%0A      require('autoprefixer')()%0A    %5D;%0A%0A
     

Add autoprefixer to watch