forked from dorzki/slack-notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
93 lines (63 loc) · 1.67 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* Gulp File by dorzki
*/
// Gulp Libraries
var gulp = require( 'gulp' );
var autoprefixer = require( 'gulp-autoprefixer' );
var scss = require( 'gulp-sass' );
var concat = require( 'gulp-concat' );
var sourcemaps = require( 'gulp-sourcemaps' );
var uglify = require( 'gulp-uglify' );
var plumber = require( 'gulp-plumber' );
// File Paths
var SCSS_PATH = 'src/scss/*.scss';
var JS_PATH = 'src/js/*.js';
var DIST = 'assets/';
// Gulp Tasks
gulp.task( 'scss', function () {
var task;
console.log( '### Starting SCSS Task ###' );
task = gulp
.src( SCSS_PATH )
.pipe( plumber( function ( err ) {
console.log( '! ERROR !' );
console.log( err );
this.emit( 'end' );
} ) )
.pipe( sourcemaps.init() )
.pipe( autoprefixer() )
.pipe( scss( {
outputStyle: 'compressed'
} ) )
.pipe( concat( 'admin-styles.min.css' ) )
.pipe( sourcemaps.write( './' ) )
.pipe( gulp.dest( DIST ) );
console.log( '### Finished SCSS Task ###' );
return task;
} );
gulp.task( 'js', function () {
var task;
console.log( '### Starting JS Task ###' );
task = gulp
.src( JS_PATH )
.pipe( plumber( function ( err ) {
console.log( '! ERROR !' );
console.log( err );
this.emit( 'end' );
} ) )
.pipe( sourcemaps.init() )
.pipe( uglify() )
.pipe( concat( 'admin-scripts.min.js' ) )
.pipe( sourcemaps.write( './' ) )
.pipe( gulp.dest( DIST ) );
console.log( '### Finished JS Task ###' );
return task;
} );
gulp.task( 'watch-scss', function () {
console.log( '[[[ Watching SCSS Task ]]]' );
gulp.watch( SCSS_PATH, [ 'scss' ] );
} );
gulp.task( 'watch-js', function () {
console.log( '[[[ Watching JS Task ]]]' );
gulp.watch( JS_PATH, [ 'js' ] );
} );