-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
106 lines (85 loc) · 2.78 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Generated by CoffeeScript 1.8.0
(function() {
var app, coffee, copy, gulp, gutil, inject, jade, livereload, nodemon, sass, sources;
gulp = require('gulp');
jade = require('gulp-jade');
gutil = require('gulp-util');
sass = require('gulp-sass');
coffee = require('gulp-coffee');
nodemon = require('gulp-nodemon');
copy = require("gulp-copy");
livereload = require('gulp-livereload');
inject = require('gulp-inject');
app = null;
sources = {
jade: "src/assets/templates/*.jade",
views: "src/views/**/*.jade",
coffee: "src/**/*.coffee",
sass: "src/**/*.scss",
overwatch: "src/**/*.{css,js,html}",
cssToInject: ['./app/assets/styles/*.css', './app/assets/libs/foundation/**/*.css'],
jsToInject: ['./app/assets/libs/angular/**/*.min.js', './app/assets/libs/angular-route/**/*.min.js', './app/assets/libs/angular-resource/**/*.min.js']
};
gulp.task("jade", function(event) {
return gulp.src([sources.jade], {
base: "./src"
}).pipe(jade({
pretty: true
})).pipe(gulp.dest("./app")).pipe(livereload());
});
gulp.task('coffee', function(event) {
return gulp.src([sources.coffee], {
base: "./src"
}).pipe(coffee()).pipe(gulp.dest("./app"));
});
gulp.task("sass", function(event) {
return gulp.src([sources.sass], {
base: "./src"
}).pipe(sass({
style: "compressed"
})).pipe(gulp.dest("./app")).pipe(livereload());
});
gulp.task("copy", function() {
return gulp.src(sources.views, {
base: "./src"
}).pipe(gulp.dest("./app")).pipe(livereload());
});
gulp.task('cssinject', function() {
return gulp.src(['src/views/layout/styles.jade'], {
base: './src'
}).pipe(inject(gulp.src(sources.cssToInject), {
ignorePath: 'app/assets',
addPrefix: 'css',
read: false,
starttag: '//- inject:css',
endtag: '//- endinject'
})).pipe(gulp.dest('./src'));
});
gulp.task('jsinject', function() {
return gulp.src(['src/views/layout/scripts.jade'], {
base: './src'
}).pipe(inject(gulp.src(sources.jsToInject), {
ignorePath: 'app/assets',
addPrefix: 'js',
read: false,
starttag: '//- inject:js',
endtag: '//- endinject'
})).pipe(gulp.dest('./src'));
});
gulp.task("watch", function() {
gulp.watch(sources.jade, ["jade"]);
gulp.watch(sources.sass, ["sass"]);
gulp.watch(sources.coffee, ["coffee"]);
gulp.watch(sources.views, ["copy"]);
});
gulp.task("develop", function() {
return nodemon({
script: "app/app.js",
ext: "jade html js",
ignore: ["./app/assets/**"]
}).on("restart", function() {
return console.log("RESTARTED!");
});
});
gulp.task("default", ["jade", "coffee", "sass", "copy", "cssinject", "jsinject", "develop", "watch"]);
}).call(this);