-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
57 lines (47 loc) · 1.54 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
var gulp = require('gulp');
var browserSync = require('browser-sync');
var minify = require('gulp-minify');
var sass = require('gulp-sass');
gulp.task('js-complie', function() {
gulp.src('src/frontend/js/*.js')
.pipe(minify({
ext:{
src:'-debug.js',
min:'.min.js'
},
exclude: ['tasks'],
ignoreFiles: ['.combo.js', '-min.js']
}))
.pipe(gulp.dest('public/frontend/js/'));
gulp.src('src/backend/js/**/*.js')
.pipe(minify({
ext:{
src:'-debug.js',
min:'.min.js'
},
exclude: ['tasks'],
ignoreFiles: ['.combo.js', '-min.js']
}))
.pipe(gulp.dest('public/backend/js/'));
});
gulp.task('js-watch', ['js-complie'], browserSync.reload);
gulp.task('scss-complie', function() {
gulp.src('src/frontend/sass/*.scss')
.pipe(sass())
.pipe(gulp.dest('public/frontend/css/'));
gulp.src('src/backend/sass/*.scss')
.pipe(sass())
.pipe(gulp.dest('public/backend/css/'));
});
gulp.task('scss-watch', ['scss-complie'], browserSync.reload);
gulp.task('watch',[], function () {
browserSync.init({
proxy: 'http://localhost/project10',
files: ['{app,resources}/**/*.php', '*.php'],
});
gulp.watch('src/frontend/sass/**/*.scss', ['scss-watch']);
gulp.watch('src/backend/sass/**/*.scss', ['scss-watch']);
gulp.watch(['*.php'], browserSync.reload);
gulp.watch('src/frontend/js/*.js', ['js-watch']);
gulp.watch('src/backend/js/*.js', ['js-watch']);
});