forked from MaistrenkoAnton/django-material-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (39 loc) · 1.14 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
const gulp = require('gulp');
const cleanCSS = require('gulp-clean-css');
const rename = require('gulp-rename');
const uglify = require('gulp-uglify');
const sass = require('gulp-dart-sass');
const gulpautoprefixer = require('gulp-autoprefixer');
const path = require('path');
const paths = {
styles: {
src: 'libs/sass/*.scss',
dest: 'material/static/material/admin/css/'
},
scripts: {
src: 'libs/js/*.js',
dest: 'material/static/material/admin/js/'
}
};
gulp.task('sass', function () {
return gulp.src(paths.styles.src)
.pipe(sass().on('error', sass.logError))
.pipe(gulpautoprefixer({overrideBrowserslist: 'defaults'}))
.pipe(cleanCSS())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest(paths.styles.dest));
});
gulp.task('watch', function() {
gulp.watch(paths.styles.src, gulp.series('sass')); // Watch all the .scss files, then run the sass task
});
gulp.task('uglify-js', function() {
return gulp.src(paths.scripts.src)
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest(paths.scripts.dest))
});
gulp.task('default', gulp.series('sass','uglify-js'));