-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
71 lines (60 loc) · 1.87 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
'use strict';
var gulp = require('gulp');
var open = require('gulp-open');
var connect = require('gulp-connect');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var concatCss = require('gulp-concat-css');
var dist = './';
gulp.task('default', ['live', 'watch', 'scripts', 'css']);
gulp.task('live', ['reload'], function() {
connect.server({
port: 1334,
livereload: true
});
gulp.src('index.html')
.pipe(open('', {
url: 'http://localhost:1337'
}));
});
gulp.task('run', ['reload'], function() {
var d = new Date();
console.log('\n ' + d.getHours() + ':' + ('0' + d.getMinutes()).slice(-2) + ':' + ('0' + d.getSeconds()).slice(-2) + '\n');
});
gulp.task('reload', ['sass', 'css'], function() {
return gulp.src(dist + 'index.html')
.pipe(connect.reload());
});
gulp.task('sass', function () {
gulp.src('css/default.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('css'));
gulp.src('css/press.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('css'));
});
gulp.task('watch', function() {
gulp.watch(['css/default.scss'], ['run']);
gulp.watch(['js/main.js'], ['scripts']);
});
gulp.task('scripts', function() {
return gulp.src([
'bower_components/modernizr/modernizr.js',
'bower_components/jquery/dist/jquery.min.js',
'bower_components/bootstrap/dist/js/bootstrap.min.js',
'bower_components/lightbox2/dist/js/lightbox.min.js',
'js/main.js'])
.pipe(concat('js/app.js'))
.pipe(gulp.dest('dist/'));
});
gulp.task('css', function () {
return gulp.src([
'css/normalize.css',
'bower_components/fontawesome/css/font-awesome.css',
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/lightbox2/dist/css/lightbox.min.css',
'css/default.css'
])
.pipe(concatCss("css/app.css"))
.pipe(gulp.dest('dist/'));
});