This repository has been archived by the owner on Jan 13, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
50 lines (44 loc) · 1.4 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
var gulp = require('gulp'),
del = require('del'),
concat = require('gulp-concat'),
// sourcemaps = require('gulp-sourcemaps'),
uglify = require('gulp-uglify-es').default,
babel = require('gulp-babel'),
csso = require('gulp-csso');
gulp.task('js', function () {
del([
'public/js/app.min.js'
]);
return gulp.src([
'node_modules/jquery/dist/jquery.js',
'node_modules/popper.js/dist/umd/popper.min.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/select2/dist/js/select2.js',
'public/js/**/*.js', '!public/js/**/*.min.js'
])
// .pipe(sourcemaps.init())
.pipe(concat('app.min.js'))
.pipe(babel())
.pipe(uglify())
// .pipe(sourcemaps.write())
.pipe(gulp.dest('public/js'))
});
gulp.task('css', function () {
del([
'public/css/style.min.css'
]);
return gulp.src([
'node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/select2/dist/css/select2.css',
'node_modules/select2-bootstrap4-theme/dist/select2-bootstrap4.css',
'public/css/**/*.css', '!public/css/**/*.min.css'
])
.pipe(concat('style.min.css'))
.pipe(csso())
.pipe(gulp.dest('public/css'))
});
gulp.task('default', gulp.parallel('js', 'css'));
gulp.task('watch', function () {
gulp.watch(['public/js/**/*.js', '!public/js/**/*.min.js'], gulp.parallel('js'));
gulp.watch(['public/css/**/*.css', '!public/css/**/*.min.css'], gulp.parallel('css'));
});