forked from AkpoFlash/just-space.v5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·57 lines (49 loc) · 1.67 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 sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var cssnano = require('gulp-cssnano');
var rename = require('gulp-rename');
var autoprefixer = require('gulp-autoprefixer');
gulp.task('sass', function(){
return gulp.src('gulp/styles/**/*.scss')
.pipe(sass())
.pipe(autoprefixer(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], { cascade: true }))
.pipe(gulp.dest('gulp/styles'))
});
gulp.task('admin-sass', function(){
return gulp.src('admin/gulp/styles/**/*.scss')
.pipe(sass())
.pipe(autoprefixer(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], { cascade: true }))
.pipe(gulp.dest('admin/gulp/styles'))
});
gulp.task('scripts', function(){
return gulp.src('gulp/scripts/**/*.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('js'));
});
gulp.task('admin-scripts', function(){
return gulp.src('admin/gulp/scripts/**/*.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('admin/js'));
});
gulp.task('styles', ['sass'], function(){
return gulp.src('gulp/styles/**/*.css')
.pipe(cssnano())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('css'));
});
gulp.task('admin-styles', ['admin-sass'], function(){
return gulp.src('admin/gulp/styles/**/*.css')
.pipe(cssnano())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('admin/css'));
});
gulp.task('watch', ['styles', 'admin-styles', 'scripts', 'admin-scripts'], function(){
gulp.watch('gulp/styles/**/*.scss', ['styles']);
gulp.watch('admin/gulp/styles/**/*.scss', ['admin-styles']);
gulp.watch('gulp/scripts/**/*.js', ['scripts']);
gulp.watch('admin/gulp/scripts/**/*.js', ['admin-scripts']);
});
gulp.task('default', ['watch']);