-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (40 loc) · 1.22 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
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
minifyCSS = require('gulp-minify-css'),
concat = require('gulp-concat'),
sass = require('gulp-sass');
var jsFiles = [
'static/js/jquery.min.js',
'static/js/toastr.min.js',
'static/js/popper.min.js',
'static/js/bootstrap.min.js',
'static/js/owlcarousel.min.js',
'static/js/particles.min.js',
'static/js/simplemde.js',
'static/js/script.js',
'static/js/admin.js',
];
gulp.task('styles', function () {
gulp.src('static/css/**/*.css')
.pipe(minifyCSS())
.pipe(concat('style.min.css'))
.pipe(gulp.dest('static/dist/css'))
});
gulp.task('scripts', function () {
return gulp.src(jsFiles)
.pipe(uglify())
.pipe(concat('script.min.js'))
.pipe(gulp.dest('static/dist/js'))
});
gulp.task('scss', function () {
gulp.src('static/scss/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(minifyCSS())
.pipe(concat('style.min.css'))
.pipe(gulp.dest('static/css'))
});
gulp.task('watch', function () {
gulp.watch('static/scss/*.scss', ['scss']);
gulp.watch('static/css/*.css', ['styles']);
gulp.watch('static/js/*.js', ['scripts']);
});