-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
28 lines (23 loc) · 713 Bytes
/
gulpfile.js
File metadata and controls
28 lines (23 loc) · 713 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
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var files = 'src/*.js';
gulp.task('uglify', function() {
return gulp.src(files)
.pipe(plumber())
.pipe(uglify({preserveComments: 'license'}))
.on('error', notify.onError('Error: <%= error %>'))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist'));
});
gulp.task('copy', function() {
return gulp.src(files)
.pipe(gulp.dest('dist'));
});
gulp.task('build', ['uglify', 'copy']);
gulp.task('default', ['build'], function() {
return gulp.watch(files, ['build']);
});