-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
67 lines (57 loc) · 1.93 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')
, sass = require('gulp-ruby-sass')
, minifyCSS = require('gulp-minify-css')
, concat = require('gulp-concat')
, plumber = require('gulp-plumber')
, uglify = require('gulp-uglify')
, rename = require('gulp-rename');
var onError = function(err) {
console.log(err);
}
gulp.task('styles', function() {
var bootstrap = gulp.src('./src/ITRLibraryBundle/Resources/public/css/bootstrap.scss')
.pipe(plumber({
errorHandler: onError
}))
.pipe(sass({ style: 'expanded' }))
.pipe(minifyCSS({keepBreaks:true}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./web/css/'));
});
gulp.task('scripts', function() {
return gulp.src('./bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js')
.pipe(plumber({
errorHandler: onError
}))
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./web/js/'));
});
gulp.task('copy', function() {
gulp.src('./bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*.{ttf,woff,eof,svg,eot}')
.pipe(gulp.dest('./web/fonts/bootstrap/'));
});
gulp.task('copy_jquery', function() {
gulp.src('./bower_components/jquery/jquery.min.js')
.pipe(gulp.dest('./web/js/'));
});
gulp.task('copy_select2', function() {
gulp.src('./bower_components/select2/dist/css/*.min.css')
.pipe(gulp.dest('./web/css/'));
gulp.src('./bower_components/select2/dist/js/*.min.js')
.pipe(gulp.dest('./web/js/'));
gulp.src('./bower_components/select2-bootstrap-theme/dist/*.min.css')
.pipe(gulp.dest('./web/css/'));
});
gulp.task('copy_images', function() {
gulp.src('./src/ITRLibraryBundle/Resources/public/img/**/*.*')
.pipe(gulp.dest('./web/img/'));
});
gulp.task('build', [
'copy',
'copy_select2',
'copy_jquery',
'copy_images',
'styles',
'scripts'
]);