src/styles/buildStyles.js
function buildStyles(conf, undertaker) {

    // Config that gets passed to node-sass.
    const sassConfig = conf.themeConfig.sass.nodeSassConf || {};

    // If we're in production mode, then compress the output CSS.
    if (conf.productionMode) {
      sassConfig.outputStyle = 'compressed';
    }

    // Any PostCSS conf and settings.
    const postCSSConf = [
      autoprefixer({
        browsers: conf.themeConfig.sass.browserSupport || 'last 2 versions'
      })
    ];

    const sassSrc = path.join(conf.themeConfig.root, conf.themeConfig.sass.src, '**', '*.scss');
    const sassDest = path.join(conf.themeConfig.root, conf.themeConfig.sass.dest);

    // The task itself.
    return undertaker.src(sassSrc)
      .pipe(gulpIf(!conf.productionMode, sourcemaps.init()))
      .pipe(sass(sassConfig).on('error', sass.logError))
      .pipe(postcss(postCSSConf))
      .pipe(gulpIf(!conf.productionMode, sourcemaps.write('.')))
      .pipe(undertaker.dest(sassDest));

}
function buildStyles(conf, undertaker) {

    // Config that gets passed to node-sass.
    const sassConfig = conf.themeConfig.sass.nodeSassConf || {};

    // If we're in production mode, then compress the output CSS.
    if (conf.productionMode) {
      sassConfig.outputStyle = 'compressed';
    }

    // Any PostCSS conf and settings.
    const postCSSConf = [
      autoprefixer({
        browsers: conf.themeConfig.sass.browserSupport || 'last 2 versions'
      })
    ];

    const sassSrc = path.join(conf.themeConfig.root, conf.themeConfig.sass.src, '**', '*.scss');
    const sassDest = path.join(conf.themeConfig.root, conf.themeConfig.sass.dest);

    // The task itself.
    return undertaker.src(sassSrc)
      .pipe(gulpIf(!conf.productionMode, sourcemaps.init()))
      .pipe(sass(sassConfig).on('error', sass.logError))
      .pipe(postcss(postCSSConf))
      .pipe(gulpIf(!conf.productionMode, sourcemaps.write('.')))
      .pipe(undertaker.dest(sassDest));

}
function buildStyles ( conf , undertaker ) { // Config that gets passed to node-sass. const sassConfig = conf . themeConfig . sass . nodeSassConf || { } ; // If we're in production mode, then compress the output CSS. if ( conf . productionMode ) { sassConfig . outputStyle = 'compressed' ; } // Any PostCSS conf and settings. const postCSSConf = [ autoprefixer ( { browsers : conf . themeConfig . sass . browserSupport || 'last 2 versions' } ) ] ; const sassSrc = path . join ( conf . themeConfig . root , conf . themeConfig . sass . src , '**' , '*.scss' ) ; const sassDest = path . join ( conf . themeConfig . root , conf . themeConfig . sass . dest ) ; // The task itself. return undertaker . src ( sassSrc ) . pipe ( gulpIf ( ! conf . productionMode , sourcemaps . init ( ) ) ) . pipe ( sass ( sassConfig ) . on ( 'error' , sass . logError ) ) . pipe ( postcss ( postCSSConf ) ) . pipe ( gulpIf ( ! conf . productionMode , sourcemaps . write ( '.' ) ) ) . pipe ( undertaker . dest ( sassDest ) ) ; }
Build project styles.

@param {ConfigParser} conf A configuration parser object.
@param {Undertaker} undertaker An Undertaker instance.

@returns {Stream} A stream of files.
Build project styles .