-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
65 lines (56 loc) · 1.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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
var server = require('gulp-develop-server');
var config = {
bowerDir: './bower_components',
sassPath: './resources/sass',
assetsDir: './public'
};
gulp.task('css', function () {
return gulp.src(config.sassPath + '/style.scss')
.pipe(sass({
precision: 8,
includePaths: [
config.sassPath,
config.bowerDir + '/bootstrap-sass/assets/stylesheets',
config.bowerDir + '/bootstrap-social',
config.bowerDir + '/font-awesome/scss'
]
}))
.pipe(autoprefixer())
.pipe(cleanCSS())
.pipe(gulp.dest(config.assetsDir+'/css'));
});
gulp.task('js', function(){
return gulp.src([
config.bowerDir + '/bootstrap-sass/assets/javascripts/bootstrap.min.js',
config.bowerDir + '/jquery/dist/jquery.min.js',
config.bowerDir + '/typeahead.js/dist/typeahead.bundle.min.js'
])
.pipe(gulp.dest(config.assetsDir+'/js'))
});
gulp.task('fonts-bootstrap', function(){
return gulp.src(config.bowerDir + '/bootstrap-sass/assets/fonts/bootstrap/*')
.pipe(gulp.dest(config.assetsDir+'/fonts/bootstrap'));
});
gulp.task('fonts-awesome', function(){
return gulp.src(config.bowerDir + '/font-awesome/fonts/*')
.pipe(gulp.dest(config.assetsDir+'/fonts'));
});
gulp.task('fonts', ['fonts-bootstrap', 'fonts-awesome']);
gulp.task('watch', function() {
gulp.watch(config.sassPath + '/**/*.scss', ['css']);
gulp.watch( [ './app/**/*.js', './bootstrap/**/*.js', './config/**/*.js', './providers/**/*.js' ], server.restart );
});
gulp.task( 'server:start', function() {
server.listen({
path: './server.js',
execArgv: ['--harmony_proxies']
});
});
gulp.task('build', ['css', 'js', 'fonts']);
gulp.task('start:dev', ['build', 'server:start', 'watch']);
gulp.task('default', ['start:dev']);