-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
43 lines (36 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
42
var gulp = require('gulp');
var templateCache = require('gulp-angular-templatecache');
var concat = require('gulp-concat');
var order = require('gulp-order');
var rename = require('gulp-rename');
var browserSync = require('browser-sync');
var watch = require('gulp-watch');
gulp.task('templateCache', function () {
return gulp.src('src/**/*.html')
.pipe(templateCache({module: 'uiSwitch'}))
.pipe(gulp.dest('src'));
});
gulp.task('js', ['templateCache'], function() {
return gulp.src('src/**/*.js')
.pipe(concat('angular-switch.tpl.js'))
.pipe(gulp.dest('./dist'));
});
gulp.task('css', function() {
return gulp.src('src/**/*.css')
.pipe(rename('angular-switch.css'))
.pipe(gulp.dest('./dist'));
});
gulp.task('browserSync', function() {
browserSync({
server: {
baseDir: '.'
}
});
});
gulp.task('watch', function() {
watch(['src/**/*.js', 'src/**/*.css', '!src/**/templates.js', 'example/*'], function() {
gulp.run('build');
});
});
gulp.task('build', ['js', 'css']);
gulp.task('dev', ['build', 'browserSync', 'watch']);