-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathgulpfile.js
43 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
34
35
36
37
38
39
40
41
var gulp = require('gulp'),
include = require('gulp-include'),
uglify = require('gulp-uglifyjs'),
sass = require('gulp-sass'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
removelogs = require('gulp-removelogs'),
stripDebug = require('gulp-strip-debug'),
mocha = require('gulp-mocha'),
uglify_config = {
'enclose' : true,
'mangle' : false
};
gulp.task('test', function () {
return gulp.src('test/range-list.test.js')
.pipe( mocha() );
});
gulp.task('min', ['test'], function () {
return gulp.src( 'src/modbus.js' )
.pipe( include() )
.pipe( stripDebug())
.pipe( uglify('modbus.min.js', uglify_config ))
.pipe( gulp.dest('dist/') );
});
gulp.task('dev', ['test'], function () {
return gulp.src( 'src/modbus.js' )
.pipe( include() )
.pipe( gulp.dest('dist/') );
});
gulp.task('default', [ 'min', 'dev' ]);