-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (39 loc) · 1.37 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
cleanCSS = require('gulp-clean-css'),
browserSync = require('browser-sync').create()
;
gulp.task('default', ['css', 'js', 'fonts']);
gulp.task('css', function () {
gulp.src(['assets/scss/style.scss'])
.pipe(concat('style.scss'))
.pipe(sass({includePaths: ['node_modules/bootstrap-sass/assets/stylesheets/'], errLogToConsole: true}))
.pipe(cleanCSS())
.pipe(gulp.dest('web/css/'))
.pipe(browserSync.stream());
});
gulp.task('js', function () {
gulp.src([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap-sass/assets/javascripts/bootstrap.min.js',
'assets/js/script.js'
])
.pipe(concat('script.js'))
.pipe(gulp.dest('web/js/'))
.pipe(browserSync.stream());
gulp.src('node_modules/jquery/dist/jquery.min.map')
.pipe(gulp.dest('web/js/'));
});
gulp.task('fonts', function () {
gulp.src('node_modules/bootstrap-sass/assets/fonts/bootstrap/*')
.pipe(gulp.dest('web/fonts/'));
});
gulp.task('watch', ['default'], function () {
browserSync.init({
proxy: 'socialhydra.dev'
});
gulp.watch('assets/scss/*.scss', ['css']);
gulp.watch('assets/js/*.js', ['js']);
gulp.watch('src/**/*.html.twig').on('change', browserSync.reload);
});