@@ -4,29 +4,25 @@ var gulp = require('gulp')
44 , gutil = require ( 'gulp-util' )
55 , plugins = require ( 'gulp-load-plugins' ) ( { camelize : true } )
66 , config = require ( '../../gulpconfig' ) . styles
7- , autoprefixer = require ( 'autoprefixer' )
8- , processors = [ autoprefixer ( config . autoprefixer ) ] // Add additional PostCSS plugins to this array as needed
97;
108
11- // Build stylesheets from source Sass files, autoprefix , and write source maps (for debugging) with rubySass
9+ // Build stylesheets from source Sass files, post-process , and write source maps (for debugging) with rubySass
1210gulp . task ( 'styles-rubysass' , function ( ) {
1311 return plugins . rubySass ( config . build . src , config . rubySass )
1412 . on ( 'error' , gutil . log ) // Log errors instead of killing the process
15- . pipe ( plugins . postcss ( processors ) )
16- . pipe ( plugins . cssnano ( config . minify ) )
17- . pipe ( plugins . sourcemaps . write ( './' ) ) // No need to init; this is set in the configuration
18- . pipe ( gulp . dest ( config . build . dest ) ) ; // Drops the unminified CSS file into the `build` folder
13+ . pipe ( plugins . cssnano ( config . cssnano ) ) // Post-process CSS (minify, autoprefix, etc.)
14+ . pipe ( plugins . sourcemaps . write ( './' ) ) // Write an external sourcemap; no need to initialize with rubysass as this is already done in the configuration
15+ . pipe ( gulp . dest ( config . build . dest ) ) ; // Render the final CSS file(s) into the `build` folder
1916} ) ;
2017
21- // Build stylesheets from source Sass files, autoprefix , and write source maps (for debugging) with libsass
18+ // Build stylesheets from source Sass files, post-process , and write source maps (for debugging) with libsass
2219gulp . task ( 'styles-libsass' , function ( ) {
2320 return gulp . src ( config . build . src )
24- . pipe ( plugins . sourcemaps . init ( ) )
21+ . pipe ( plugins . sourcemaps . init ( ) ) // Note that sourcemaps need to be initialized with libsass
2522 . pipe ( plugins . sass ( config . libsass ) )
26- . pipe ( plugins . postcss ( processors ) )
27- . pipe ( plugins . cssnano ( config . minify ) )
28- . pipe ( plugins . sourcemaps . write ( './' ) ) // Writes an external sourcemap
29- . pipe ( gulp . dest ( config . build . dest ) ) ; // Drops the unminified CSS file into the `build` folder
23+ . pipe ( plugins . cssnano ( config . cssnano ) )
24+ . pipe ( plugins . sourcemaps . write ( './' ) )
25+ . pipe ( gulp . dest ( config . build . dest ) ) ;
3026} ) ;
3127
3228// Easily configure the Sass compiler from `/gulpconfig.js`
0 commit comments