-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (37 loc) · 1.33 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
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');
gulp.task('js', function(){
return gulp.src('assets/src/frontend/js/*.js')
.pipe(plumber())
.pipe(uglify())
.pipe(concat('actions.js', { newLine: '\r\n\r\n' }))
.pipe(gulp.dest('assets/dist/frontend/js/'));
});
gulp.task('adminJs', function(){
return gulp.src('assets/src/dashboard/js/*.js')
.pipe(plumber())
.pipe(uglify())
.pipe(concat('actions.js', { newLine: '\r\n\r\n' }))
.pipe(gulp.dest('assets/dist/dashboard/js/'));
});
gulp.task('sass', function(){
return gulp.src('assets/src/frontend/sass/*.scss')
.pipe(plumber())
.pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest('assets/dist/frontend/css/'));
});
gulp.task('adminSass', function(){
return gulp.src('assets/src/dashboard/sass/*.scss')
.pipe(plumber())
.pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest('assets/dist/dashboard/css/'));
});
gulp.task('watch', function(){
gulp.watch('assets/src/*/js/*.js', gulp.series('js', 'adminJs' ) );
gulp.watch('assets/src/*/sass/*.scss', gulp.series('sass', 'adminSass' ) );
});
gulp.task('build', gulp.series( 'js', 'sass', 'adminJs', 'adminSass' ) );
gulp.task('default', gulp.series( 'build', 'watch' ) );