-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathgulpfile.js
More file actions
27 lines (22 loc) · 641 Bytes
/
gulpfile.js
File metadata and controls
27 lines (22 loc) · 641 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
'use strict';
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const sourcemaps = require('gulp-sourcemaps');
const rename = require('gulp-rename');
// Build app.js
gulp.task('scripts', function () {
return gulp.src('restables.js')
.pipe(uglify({
preserveComments: 'license'
}))
.pipe(rename('restables.min.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./'));
});
// Watch task
gulp.task('watch', function () {
gulp.watch(['*.js'], ['scripts']);
});
// Build by default
gulp.task('default', ['scripts']);
gulp.task('build:watch', ['scripts', 'watch']);