-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (33 loc) · 1 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
/**
* Gulpfile
*
* Rename and Minify JavaScript... and more (later).
*
* Install Command:
* npm install gulp gulp-rename gulp-uglify
*/
var gulp = require('gulp');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
gulp.task('js', function () {
gulp.src('assets/js/dev/nf-upgrade-handler.js')
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('assets/js/min/')); //the destination folder
gulp.src('js/dev/ninja-forms-admin.js')
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('js/min/')); //the destination folder
});
// Watch Files For Changes
gulp.task('watch', function() {
gulp.watch('js/dev/ninja-forms-admin.js', ['js']);
gulp.watch('assets/js/dev/nf-upgrade-handler.js', ['js']);
});
// Default Task
gulp.task('default', ['js', 'watch']);
function swallowError (error) {
//If you want details of the error in the console
console.log(error.toString());
this.emit('end');
}