-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (39 loc) · 1.13 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
//Deklaracja zmiennych
var sass = require('gulp-sass');
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var runSequence = require('run-sequence');
//Definicja tasków
gulp.task('sass', () => {
return gulp.src('resources/assets/sass/**/*.scss')
.pipe(sass()) // Converts Sass to CSS with gulp-sass
.pipe(gulp.dest('public/css'))
.pipe(browserSync.reload({
stream: true
}))
});
//Definicja tasków
gulp.task('watch', ['browserSync', 'sass'], () => {
gulp.watch('resources/assets/sass/**/*.scss', ['sass']);
gulp.watch('app/*.html', browserSync.reload);
gulp.watch('app/js/**/*.js', browserSync.reload);
});
//Definicja tasków
gulp.task('browserSync', function () {
browserSync.init({
server: {
baseDir: 'app'
},
})
});
//Definicja tasków
gulp.task('default', function (callback) {
runSequence(['watch', 'sass', 'browserSync'],
callback
)
})
//Definicja tasków
gulp.task('build', function (callback) {
runSequence('clean:dist', ['default', 'images', 'fonts'], 'useref', 'scripts',
callback)
})