-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
61 lines (55 loc) · 1.49 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* IMPORT MODULES */
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var stripCSSComments = require('gulp-strip-css-comments');
var removeEmptyLines = require('gulp-remove-empty-lines');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var postCSSCustomProperties = require('postcss-custom-properties');
var postCSSImport = require('postcss-import');
var postCSSStyleGuide = require('postcss-style-guide');
var nano = require('cssnano');
/* DECLARE VARS */
var PATHS = {
docs: {
src: './',
dest: './docs/'
},
test: {
src: './test/',
dest: './test/'
}
};
/* DECLARE TASKS */
/**
* 'Default' Gulp task, executed when `gulp` is run from the
* command line with *no* arguments.
*
* The following tasks are executed *before* the contents of
* the `default` task.
* - `test`
* - `docs`
*/
gulp.task( 'default', [ 'test' ], function() {
console.log( 'INSIDE TASK: `default`' );
} );
/**
* ...
*/
gulp.task( 'test', function() {
return gulp.src( PATHS.test.src + 'input.scss' )
.pipe(
sass( {
outputStyle: 'expanded'
} )
.on( 'error', sass.logError )
)
.pipe( stripCSSComments() )
.pipe( removeEmptyLines() )
.pipe( rename( function( path ) {
path.basename = 'output';
} ) )
.pipe( gulp.dest( PATHS.test.dest) );
} );