-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
57 lines (47 loc) · 1.5 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var stylus = require('gulp-stylus');
var clean = require('gulp-clean');
gulp.task('copy-bower-components', function(){
return gulp.src('bower_components/**/dist/*.min.js')
.pipe(rename(function(path){path.dirname = '';}))
.pipe(gulp.dest('build/public'))
});
gulp.task('copy-node-components', function(){
return gulp.src(['models', 'view', 'controllers', 'routes', 'app.js'])
.pipe(gulp.dest('build'));
});
gulp.task('copy-static-components', function(){
return gulp.src('static/**')
.pipe(gulp.dest('build/public'));
});
gulp.task('copy-javascript-components', function(){
return gulp.src('javascript/**/*.js')
.pipe(gulp.dest('build/public'))
});
gulp.task('copy-stylesheet-components', function(){
return gulp.src('stylesheets/**/*.stylus')
.pipe(stylus())
.pipe(gulp.dest('build/public'))
});
// Watch Our Files
gulp.task('watch', function() {
gulp.watch('javascript/**/*.js', ['copy-javascript-components']);
gulp.watch('stylesheets/**/*.stylus', ['copy-stylesheet-components']);
gulp.watch(
['models/**/*', 'views/**/*', 'controllers/**/*', 'routes/**/*', 'app.js'], ['copy-node-components'])
});
gulp.task('clean', function(){
return gulp.src('build/**')
.pipe(clean());
});
// Default
gulp.task('default', [
'copy-bower-components',
'copy-node-components',
'copy-static-components',
'copy-javascript-components',
'copy-stylesheet-components',
]);