forked from readthedocs/readthedocs-sphinx-search
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
36 lines (31 loc) · 1.02 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
"use strict";
var autoprefixer = require("gulp-autoprefixer"),
csso = require("gulp-csso"),
del = require("del"),
gulp = require("gulp"),
rename = require("gulp-rename"),
runSequence = require("run-sequence"),
uglify = require("gulp-uglify"),
babel = require("gulp-babel");
gulp.task("styles", function() {
return gulp
.src("sphinx_search/static/css/rtd_sphinx_search.css")
.pipe(autoprefixer())
.pipe(csso())
.pipe(rename({ extname: ".min.css" }))
.pipe(gulp.dest("sphinx_search/static/css"));
});
gulp.task("scripts", function() {
return gulp
.src("sphinx_search/static/js/rtd_sphinx_search.js")
.pipe(babel({ presets: ["@babel/env"] }))
.pipe(uglify())
.pipe(rename({ extname: ".min.js" }))
.pipe(gulp.dest("sphinx_search/static/js"));
});
gulp.task("clean", function() {
return del(["sphinx_search/**/rtd_sphinx_search.min.*"]);
});
gulp.task("default", ["clean"], function() {
runSequence("styles", "scripts");
});