forked from paveliko/person-web-component
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
57 lines (50 loc) · 1.63 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var path = require('path'),
gulp = require('gulp'),
less = require('gulp-less'),
concat = require('gulp-concat'),
connect = require('gulp-connect'),
livereload = require('gulp-livereload');
var libs = [
'bower_components/angular/angular.js',
'bower_components/jquery/dist/jquery.js',
'bower_components/bootstrap/dist/js/bootstrap.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-aria/angular-aria.js',
'bower_components/angular-messages/angular-messages.js',
'bower_components/angular-material/angular-material.js'
];
gulp.task('js:lib', function() {
gulp.src(libs)
.pipe(concat('lib.js'))
.pipe(gulp.dest('./public/js'));
});
gulp.task('js:app', function() {
gulp.src('public/js/app/**/*.js')
.pipe(concat('app.js'))
.pipe(gulp.dest('./public/js'))
.pipe(livereload());
});
gulp.task('less', function() {
gulp.src('public/css/less/style.less')
.pipe(less({
paths: [path.join(__dirname, 'less', 'includes')]
}))
.pipe(concat('style.css'))
.pipe(gulp.dest('./public/css'))
.pipe(livereload());
});
gulp.task('connect', function() {
connect.server({
root: 'public',
port: 3000,
livereload: true
});
});
// Rerun the task when a file changes
gulp.task('watch', function() {
livereload.listen();
gulp.watch('public/css/less/**/*.less', ['less']);
gulp.watch('public/js/app/**/*.js', ['js:app']);
});
// The default task (called when you run `gulp` from cli)
gulp.task('default', ['less', 'js:lib', 'js:app', 'watch', 'connect']);