forked from afeld/marionette-meeting-booker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
89 lines (81 loc) · 2.9 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var stylus = require('gulp-stylus');
var minifyCSS = require('gulp-minify-css');
var watch = require('gulp-watch');
gulp.task('copyLibs', function() {
gulp.src([
'bower_components/backbone/backbone.js',
'bower_components/marionette/lib/backbone.marionette.js',
'bower_components/backbone.radio/build/backbone.radio.js',
'bower_components/Backbone.localStorage/backbone.localStorage.js'
])
.pipe(gulp.dest('public/dist'));
});
gulp.task('concatJS', function() {
return gulp.src([
'public/javascripts/**/*.js'
])
.pipe(concat('meetingBookerBundle.js'))
.pipe(gulp.dest('public/dist'));
});
gulp.task('uglifyJS', function() {
return gulp.src([
'bower_components/jquery/dist/jquery.js',
'bower_components/pickadate/lib/picker.js',
'bower_components/pickadate/lib/picker.date.js',
'bower_components/pickadate/lib/picker.time.js',
'bower_components/pickadate/lib/legacy.js',
'bower_components/semantic-ui/build/packaged/javascript/semantic.min.js',
'bower_components/json2/json2.js,',
'bower_components/underscore/underscore.js'
])
.pipe(concat('bundle.js'))
.pipe(uglify())
.pipe(gulp.dest('public/dist'));
});
gulp.task('compileCSS', function () {
return gulp.src([
'public/stylesheets/*.styl'
])
.pipe(stylus())
.pipe(gulp.dest('public/stylesheets'));
});
gulp.task('minifyCSS', function() {
return gulp.src([
'bower_components/pickadate/lib/themes/default.css',
'bower_components/pickadate/lib/themes/default.date.css',
'bower_components/pickadate/lib/themes/default.time.css',
'bower_components/semantic-ui/build/packaged/css/semantic.min.css',
'public/stylesheets/*.css'
])
.pipe(concat('bundle.css'))
.pipe(minifyCSS({keepBreaks:true}))
.pipe(gulp.dest('public/dist'));
});
gulp.task('build', function() {
return gulp.src([
'bower_components/jquery/dist/jquery.js',
'bower_components/pickadate/lib/picker.js',
'bower_components/pickadate/lib/picker.date.js',
'bower_components/pickadate/lib/picker.time.js',
'bower_components/pickadate/lib/legacy.js',
'bower_components/semantic-ui/build/packaged/javascript/semantic.min.js',
'bower_components/json2/json2.js,',
'bower_components/underscore/underscore.js',
'bower_components/backbone/backbone.js',
'bower_components/marionette/lib/backbone.marionette.js',
'bower_components/backbone.radio/build/backbone.radio.js',
'bower_components/Backbone.localStorage/backbone.localStorage-min.js',
'public/javascripts/**/*.js'
])
.pipe(concat('bundle.js'))
.pipe(uglify())
.pipe(gulp.dest('public/dist'));
});
gulp.task('watch', function() {
gulp.watch('public/stylesheets/**.styl', ['compileCSS', 'minifyCSS']);
gulp.watch('public/javascripts/**/*.js', ['concatJS']);
});
gulp.task('default', ['watch']);