-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
33 lines (30 loc) · 1.03 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
var gulp = require('gulp'),
gls = require('gulp-live-server'),
uglify = require('gulp-uglifyjs'),
rename = require("gulp-rename");
//___________________________________________________
gulp.task('default', ['lint', 'uglify']);
gulp.task('lint', ['jslint']);
//___________________________________________________
// npm i --save-dev gulp-jshint jshint-stylish
var jshint = require('gulp-jshint'),
stylish = require('jshint-stylish');
gulp.task('jslint', function() {
gulp.src('./index.js')
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
//___________________________________________________
gulp.task('serve-test', function() {
var server = gls.static(".", 8287);
server.start();
//live reload changed resource(s)
gulp.watch(['index.js', 'test/**/*.js'], server.notify);
});
//___________________________________________________
gulp.task('uglify', function() {
gulp.src('index.js')
.pipe(uglify())
.pipe(rename('decompose.min.js'))
.pipe(gulp.dest('dist'))
});