-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
57 lines (44 loc) · 1.32 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
51
52
53
54
55
56
57
const cssmin = require('gulp-cssmin');
const del = require("del");
const gulp = require("gulp");
const imagemin = require('gulp-imagemin');
const rename = require('gulp-rename');
const uglify = require('gulp-uglify');
const paths = {
npm: "./node_modules/",
dest: "./build/"
};
gulp.task("css", function(done) {
gulp.src(paths.npm + "Camera/css/camera.css")
.pipe(cssmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(paths.dest + "css/"));
done();
});
gulp.task('images', function(done) {
gulp.src(paths.npm + "Camera/images/*.{gif,png}")
.pipe(imagemin())
.pipe(gulp.dest(paths.dest + "images/"));
gulp.src(paths.npm + "Camera/images/patterns/*.png")
.pipe(imagemin())
.pipe(gulp.dest(paths.dest + "images/patterns/"));
done();
});
gulp.task('scripts', function(done) {
gulp.src([paths.npm + "Camera/scripts/*.js", "!"+paths.npm + "Camera/scripts/camera.min.js"])
.pipe(uglify())
.pipe(gulp.dest(paths.dest + "scripts/"));
done();
});
gulp.task("php", function (done) {
gulp.src("./src/**/*.php")
.pipe(gulp.dest(paths.dest));
done();
});
gulp.task("clean", function() {
return del(paths.dest);
});
// Build Sequences
// ---------------
gulp.task("build", gulp.series("clean", gulp.parallel("css", "images", "scripts", "php")));
exports.default = gulp.series("build");