forked from monterail/angular-mighty-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
82 lines (70 loc) · 1.94 KB
/
gulpfile.js
File metadata and controls
82 lines (70 loc) · 1.94 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
var gulp = require("gulp"),
gutil = require('gulp-util'),
watch = require("gulp-watch"),
clean = require("gulp-clean"),
connect = require("gulp-connect"),
changed = require("gulp-changed"),
bower = require("gulp-bower"),
// compilers
less = require("gulp-less"), // gulp-sass is broken
coffee = require("gulp-coffee"),
coffeelint = require("gulp-coffeelint"),
plumber = require('gulp-plumber');
var warn = function(err) { console.warn(err); };
var paths = {
src: "./src/",
dst: "./build/"
}
var onError = function (err) {
gutil.beep();
console.log(err);
};
gulp.task("default", ["bower", "build"]);
gulp.task("build", ["coffee", "less"])
gulp.task("server", ["build", "watch"], function() {
connect.server({
root: '.',
port: 8000
});
});
gulp.task("clean", function(){
return gulp.src(paths.dst, {read: false})
.pipe(clean());
})
gulp.task("watch", function(){
return gulp.watch(paths.src + "**/*", ["build"]);
});
gulp.task("bower", function() {
return bower("bower_components")
.pipe(gulp.dest("bower_components"))
});
// compilers
// gulp.task("copy", function(){
// return gulp.src(paths.src + "**/*.{json,png,jpg,gif,eot,svg,ttf,woff}")
// .pipe(changed(paths.dst))
// .pipe(gulp.dest(paths.dst))
// .pipe(connect.reload());
// });
gulp.task("less", function(){
return gulp.src(paths.src + "**/*.less")
.pipe(changed(paths.dst, { extension: '.css' }))
.pipe(plumber({
errorHandler: onError
}))
.pipe(less().on('error', warn))
.pipe(gulp.dest(paths.dst))
.pipe(connect.reload());
});
gulp.task("coffee", function(){
return gulp.src(paths.src + "**/*.coffee")
.pipe(changed(paths.dst, { extension: '.js' }))
.pipe(coffeelint())
.pipe(coffeelint.reporter())
.pipe(plumber({
errorHandler: onError
}))
.pipe(coffee().on('error', warn))
.pipe(gulp.dest(paths.dst))
.pipe(connect.reload());
});
//