-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
40 lines (34 loc) · 1.01 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
'use strict';
let gulp = require('gulp'),
rename = require("gulp-rename"),
notify = require('gulp-notify'),
autoprefixer = require('gulp-autoprefixer'),
sass = require('gulp-sass');
//css
gulp.task('css', () => {
return gulp.src('./public/assets/scss/styles.scss')
.pipe(sass( { outputStyle: 'compressed' } ))
.pipe(autoprefixer({
browsers: ['last 10 versions'],
cascade: false
}))
.pipe(rename('styles.css'))
.pipe(gulp.dest('./public/assets/css/'))
.pipe(notify('Compile Sass Done!'));
});
gulp.task('css-admin', () => {
return gulp.src('./admin/assets/scss/admin-style.scss')
.pipe(sass( { outputStyle: 'compressed' } ))
.pipe(autoprefixer({
browsers: ['last 10 versions'],
cascade: false
}))
.pipe(rename('admin-style.css'))
.pipe(gulp.dest('./admin/assets/css/'))
.pipe(notify('Compile Sass Done!'));
});
//watch
gulp.task('watch', () => {
gulp.watch('./public/assets/scss/**', ['css']);
gulp.watch('./admin/assets/scss/**', ['css-admin']);
});