-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (40 loc) · 1.55 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'use strict';
var gulp = require( 'gulp' );
var sass = require( 'gulp-sass' );
var cssNano = require( 'gulp-cssnano' );
var rename = require( 'gulp-rename' );
sass.compiler = require( 'node-sass' );
gulp.task( 'sass:main', function () {
return gulp.src( './sass/style.scss', { sourcemaps: true } )
.pipe( sass().on( 'error', sass.logError ) )
.pipe( gulp.dest( './', { sourcemaps: true } ) )
.pipe( cssNano() )
.pipe( rename( {
extname: '.min.css'
} ) )
.pipe( gulp.dest( './', { sourcemaps: true } ) );
} );
gulp.task( 'sass:blocks', function () {
return gulp.src( './sass/blocks.scss', { sourcemaps: true } )
.pipe( sass().on( 'error', sass.logError ) )
.pipe( gulp.dest( './css/', { sourcemaps: true } ) )
.pipe( cssNano() )
.pipe( rename( {
extname: '.min.css'
} ) )
.pipe( gulp.dest( './css/', { sourcemaps: true } ) );
} );
gulp.task( 'sass:admin', function () {
return gulp.src( './sass/admin.scss', { sourcemaps: true } )
.pipe( sass().on( 'error', sass.logError ) )
.pipe( gulp.dest( './css/', { sourcemaps: true } ) )
.pipe( cssNano() )
.pipe( rename( {
extname: '.min.css'
} ) )
.pipe( gulp.dest( './css/', { sourcemaps: true } ) );
} );
gulp.task( 'watch', function() {
gulp.watch('./sass/**/*.scss', gulp.series( [ 'sass:main', 'sass:blocks', 'sass:admin'] ) );
} );
gulp.task( 'default', gulp.series( [ 'sass:main', 'sass:blocks', 'sass:admin' ] ) );