forked from mozilla/fx-private-relay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (35 loc) · 1.03 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
const { src, watch, series, dest } = require("gulp");
const sass = require("gulp-sass")(require("sass"));
const del = require("del");
const sourcemaps = require("gulp-sourcemaps");
// directory for building LESS, SASS, and bundles
const buildDir = "./static/scss/libs/protocol/";
const finalDir = "./static/css/";
function clean() {
return del([
finalDir
]);
}
function reset() {
return del([
finalDir,
buildDir,
]);
}
function styles() {
return src("./static/scss/app.scss")
.pipe(sourcemaps.init())
.pipe(sass().on("error", sass.logError))
.pipe(sourcemaps.write("."))
.pipe(dest(finalDir));
}
function assetsCopy() {
return src(["./node_modules/@mozilla-protocol/core/protocol/**/*"]).pipe(dest(buildDir));
}
exports.build = series(reset, assetsCopy, styles);
exports.default = series(
clean, assetsCopy, styles, function() {
// You can use a single task
watch("./static/scss/**/*.scss", { ignoreInitial: false }, series(clean, styles));
}
);