forked from Yago/Bootsketch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
68 lines (57 loc) · 2.55 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
var gulp = require('gulp'),
gutil = require('gulp-util'),
notify = require('gulp-notify'),
jshint = require('gulp-jshint'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
browserSync = require('browser-sync'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
shell = require('gulp-shell'),
stylish = require('jshint-stylish'),
clean = require('gulp-clean');
gulp.task('vendors', function() {
gulp.src([
'bower_components/jquery/jquery.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/affix.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/alert.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/button.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/carousel.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/collapse.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/dropdown.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/modal.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/tooltip.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/popover.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/scrollspy.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/tab.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/transition.js'
])
.pipe(concat('vendors.min.js'))
.pipe(uglify())
.pipe(gulp.dest('build/js'));
});
gulp.task('styles', function() {
return gulp.src('assets/sass/bootsketch.scss')
.pipe(sass())
.on('error', gutil.beep)
.on('error', notify.onError("Error: <%= error.message %>"))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))
.pipe(minifycss())
.pipe(gulp.dest('build/css'));
});
gulp.task('styleguide', shell.task([
'hologram'
]));
gulp.task('browser-sync', function() {
browserSync.init(['styleguide/*.html'], {
proxy: 'localhost',
open: false,
debounce: 400
});
});
gulp.task('default', ['vendors', 'watch', 'browser-sync']);
gulp.task('watch', function() {
gulp.watch('assets/sass/**/*.scss', ['styles', 'styleguide']);
});