-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
30 lines (26 loc) · 793 Bytes
/
gulpfile.js
File metadata and controls
30 lines (26 loc) · 793 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var webserver = require('gulp-webserver');
var stylish = require('jshint-stylish');
gulp.task('lint', function() {
return gulp.src('./src/*.js')
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
gulp.task('compress', function() {
return gulp.src('src/*.js')
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('webserver', function() {
var PORT = 3000;
console.log('starting test server on port :p...'.replace(':p',PORT));
return gulp.src('.')
.pipe(webserver({
port: PORT,
open: 'http://localhost::p/test'.replace(':p',PORT)
}));
});
gulp.task('default', ['lint', 'compress']);
gulp.task('test', ['lint', 'compress', 'webserver'])