-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
41 lines (36 loc) · 1.27 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
(function () {
'use strict';
const gulp = require('gulp');
const connect = require('gulp-connect');
const jshint = require('gulp-jshint');
const stylish = require('jshint-stylish');
const gulpif = require('gulp-if');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
gulp.task('ngRoute-demo', function () {
gulp.watch(['./src/**/*', './ngRoute-demo/**/*'], ['reload']);
connect.server({
root: ['./ngRoute-demo', './'],
livereload: true
});
});
gulp.task('ui.router-demo', function () {
gulp.watch(['./src/**/*', './ui.router-demo/**/*'], ['reload']);
connect.server({
root: ['./ui.router-demo', './'],
livereload: true
});
});
gulp.task('reload', function () {
gulp.src(['./src/**/*', './ui.router-demo/**/*', './ngRoute-demo/**/*'])
.pipe(gulpif('*.js', jshint()))
.pipe(gulpif('*.js', jshint.reporter(stylish)))
.pipe(connect.reload());
});
gulp.task('build', function () {
return gulp.src('./src/*.js')
.pipe(concat('angular-dirtyform-check.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist'));
})
})();