forked from vaibhavpandeyvpz/acraviz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
66 lines (62 loc) · 2.41 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
var gulp = require('gulp'),
gulpAddSrc = require('gulp-add-src'),
gulpAppendSrc = gulpAddSrc.append,
gulpConcat = require('gulp-concat'),
gulpCssmin = require('gulp-cssmin'),
gulpFilter = require('gulp-filter'),
gulpLess = require('gulp-less'),
gulpPlumber = require('gulp-plumber'),
gulpPrepend = gulpAddSrc.prepend,
gulpSass = require('gulp-sass'),
gulpUglify = require('gulp-uglify');
gulp.task('css', function() {
var sass;
return gulp.src('./assets/less/app.less')
.pipe(gulpPlumber())
.pipe(gulpLess())
.pipe(gulpAppendSrc([
'./bower_components/datatables-responsive/css/responsive.bootstrap.scss'
]))
.pipe(sass = gulpFilter(['**/*.scss'], {restore: true}))
.pipe(gulpSass())
.pipe(sass.restore)
.pipe(gulpCssmin({
keepSpecialComments: 0
}))
.pipe(gulpAppendSrc([
'./bower_components/font-awesome/css/font-awesome.min.css',
'./bower_components/datatables/media/css/dataTables.bootstrap.min.css'
]))
.pipe(gulpConcat('app.css'))
.pipe(gulp.dest('./www/css'));
});
gulp.task('default', ['css', 'fonts', 'js']);
gulp.task('fonts', function() {
var files = [
'./bower_components/bootstrap/fonts/*.{eot,svg,ttf,woff,woff2}',
'./bower_components/font-awesome/fonts/*.{eot,otf,svg,ttf,woff,woff2}'
];
return gulp.src(files)
.pipe(gulpPlumber())
.pipe(gulp.dest('./www/fonts'));
});
gulp.task('js', function() {
return gulp.src('./assets/js/app.js')
.pipe(gulpPlumber())
.pipe(gulpPrepend([
'./bower_components/bootbox.js/bootbox.js'
]))
.pipe(gulpUglify())
.pipe(gulpPrepend([
'./bower_components/jquery/dist/jquery.min.js',
'./bower_components/bootstrap/dist/js/bootstrap.min.js',
'./bower_components/bootstrap-growl/jquery.bootstrap-growl.min.js',
'./bower_components/datatables/media/js/jquery.dataTables.min.js',
'./bower_components/datatables/media/js/dataTables.bootstrap.min.js',
'./bower_components/datatables-responsive/js/dataTables.responsive.js',
'./bower_components/typeahead.js/dist/typeahead.bundle.min.js',
'./bower_components/handlebars/handlebars.min.js'
]))
.pipe(gulpConcat('app.js'))
.pipe(gulp.dest('./www/js'));
});