forked from tabler/tabler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (43 loc) · 1.46 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'),
sass = require('gulp-sass'),
rename = require('gulp-rename'),
autoprefixer = require('gulp-autoprefixer'),
rtlcss = require('gulp-rtlcss'),
pckg = require('./package.json');
gulp.task('styles', function () {
return gulp.src('src/assets/scss/bundle.scss', { base: '.' })
.pipe(sass({
precision: 8,
outputStyle: 'expanded'
}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: pckg.browserslist,
cascade: false
}))
.pipe(rename('dashboard.css'))
.pipe(gulp.dest('src/assets/css/'))
.pipe(rtlcss())
.pipe(rename('dashboard.rtl.css'))
.pipe(gulp.dest('src/assets/css/'));
});
gulp.task('styles-plugins', function () {
return gulp.src('src/assets/plugins/**/plugin.scss', { base: '.' })
.pipe(sass({
precision: 6,
outputStyle: 'expanded'
}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: pckg.browserslist,
cascade: false
}))
.pipe(rename(function(path) {
path.extname = '.css';
}))
.pipe(gulp.dest('.'));
});
gulp.task('watch', ['styles', 'styles-plugins'], function() {
gulp.watch('src/assets/scss/**/*.scss', ['styles']);
gulp.watch('src/assets/plugins/**/*.scss', ['styles-plugins']);
});
gulp.task('build', ['styles', 'styles-plugins']);
gulp.task('default', ['build']);