-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
39 lines (35 loc) · 919 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
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const jasmine = require('gulp-jasmine');
const jshint = require('gulp-jshint');
const testFile = './spec/data-mask.spec.js';
const sourceFilePath = './src/data-mask.js';
const destinationFileName = 'data-mask.min.js';
/**
* @name js:build
* @description Build js file.
*/
gulp.task('js:build', function () {
return gulp.src(sourceFilePath)
.pipe(uglify())
.pipe(rename(destinationFileName))
.pipe(gulp.dest('dist'));
});
/**
* @name js:test
* @description Run unit tests.
*/
gulp.task('js:test', function () {
gulp.src(testFile)
.pipe(jasmine());
});
/**
* @name js:hint
* @description Run js-hint for source file.
*/
gulp.task('js:hint', function () {
gulp.src(sourceFilePath)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
});