forked from monarkee/bumble
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
95 lines (83 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
var gulp = require('gulp'),
gutil = require('gulp-util'),
concat = require('gulp-concat'),
sass = require('gulp-ruby-sass'),
uglify = require('gulp-uglify'),
autoprefixer = require('gulp-autoprefixer'),
plumber = require('gulp-plumber'),
coffee = require('gulp-coffee'),
shell = require('gulp-shell'),
livereload = require('gulp-livereload');
var SRC = './resources/assets/',
BOWER = './public/bower_components/',
PACKAGES = './public/packages/',
NODE = './node_modules/',
DIST = './public/';
// Javascript Sources
// ------------------------------------------------------------------------------------ */
var vendorJS = [
NODE + 'jquery/dist/jquery.min.js',
BOWER + 'trumbowyg/dist/trumbowyg.min.js',
BOWER + 'switchery/dist/switchery.min.js',
PACKAGES + 'tipr/tipr.min.js',
BOWER + 'datetimepicker/jquery.datetimepicker.js',
BOWER + 'MirrorMark/dist/js/mirrormark.package.js',
NODE + 'fastclick/lib/fastclick.js',
];
var onError = function (err) {
gutil.beep();
};
// SCSS Compiling and Minification
gulp.task('scss', function () {
return gulp.src([
SRC + 'sass/bumble.scss',
])
.pipe(plumber({
errorHandler: onError
}))
.pipe(sass({
debugInfo: false,
lineNumbers: false
}))
.pipe(autoprefixer())
.pipe(livereload())
.pipe(gulp.dest(DIST + '/css'));
});
gulp.task('coffee', function() {
gulp.src(SRC + 'coffee/**/*.coffee')
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(gulp.dest(DIST + 'js'));
});
// Concat Vendor Javascripts
// ------------------------------------------------------------------------------------ */
gulp.task('vendorJS', function() {
gulp.src(vendorJS)
.pipe(concat('vendor.min.js'))
.pipe(uglify())
.pipe(gulp.dest(DIST + 'js'));
});
gulp.task('publish', ['scss', 'coffee', 'vendorJS'], function() {
// gulp.src('').pipe(shell('cd ~/Sites/bumble && php artisan asset:publish --bench=monarkee/bumble'), {ignoreErrors: true});
// gulp.src('').pipe(shell('cd ~/Sites/bumblecms && php artisan asset:publish --path="vendor/monarkee/bumble/public" monarkee/bumble'), {ignoreErrors: true});
});
/* Blade Templates */
gulp.task('blade', function () {
return gulp.src('./views/**/*.blade.php')
.pipe(livereload(server));
});
gulp.task('watch', function () {
// Watch .scss files
gulp.watch([
SRC + 'sass/**/*.scss',
], ['scss', 'publish']);
// Watch Coffee files
gulp.watch([
SRC + 'coffee/**/*.coffee',
], ['coffee']);
// Watch Blade files
gulp.watch([
'./views/**/*.blade.php'
], ['blade']);
});
// Gulp Default Task
gulp.task('default', ['vendorJS', 'scss', 'coffee', 'publish', 'watch']);