forked from mihai-vlc/ultimateSelect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
50 lines (38 loc) · 1014 Bytes
/
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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var connect = require('gulp-connect');
var rename = require('gulp-rename');
var open = require('open');
var port = 8001;
gulp.task('uglify', function() {
return gulp.src('src/**.js')
// minify the js files
.pipe(uglify({
preserveComments: 'some'
}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist/'));
});
gulp.task('copy', function() {
return gulp.src('src/**.{js,css}')
.pipe(gulp.dest('dist/'))
});
// start a development server
gulp.task('serve', function () {
connect.server({
port: port,
livereload: true
});
return true;
});
gulp.task('test', ['serve'], function() {
open('http://localhost:' + port + '/test');
var files = ['test/**/*.js', 'src/**/*.{js,css}'];
gulp.watch(files, function () {
gulp.src(files)
.pipe(connect.reload());
});
});
gulp.task('build', ['uglify', 'copy']);