forked from gravmatt/js-notify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
32 lines (28 loc) · 769 Bytes
/
gulpfile.js
File metadata and controls
32 lines (28 loc) · 769 Bytes
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
/*!
Copyright (c) 2016 Rene Tanczos <gravmatt@gmail.com> - The MIT License (MIT)
*/
var gulp = require('gulp');
const rename = require('gulp-rename');
const path = require('path');
const uglify = require('gulp-uglify');
gulp.task('js', () => {
return gulp.src([
'notify.js'
])
.pipe(uglify({
preserveComments: 'license',
mangle: true
}))
.pipe(rename(function(path) {
path.basename += '.min'
return path;
}))
.pipe(gulp.dest('.'));
});
gulp.task('js:watch', function() {
gulp.watch(['notify.js'], gulp.task('js'))
.on('change', function(event) {
console.log('File ' + path.basename(event) + ' was changed! Running tasks...');
});
});
gulp.task('default', gulp.parallel('js'));