-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (43 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
const gulp = require("gulp");
const sass = require("gulp-sass")(require("sass"));
const del = require("del");
const rename = require("gulp-rename");
const cssnano = require("cssnano");
const postcss = require("gulp-postcss");
const sourcemaps = require("gulp-sourcemaps");
const APP_NAME = "eunicore";
const STATIC_PATH = APP_NAME + "/static/" + APP_NAME;
const SASS_CONFIG = {
includePaths: ["node_modules"],
};
gulp.task("styles", () => {
return gulp
.src(STATIC_PATH + "/scss/**/*.scss")
.pipe(sourcemaps.init())
.pipe(sass(SASS_CONFIG).on("error", sass.logError))
.pipe(gulp.dest(STATIC_PATH + "/css/"))
.pipe(postcss([cssnano()]))
.pipe(
rename({
suffix: ".min",
})
)
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(STATIC_PATH + "/css/"));
});
gulp.task("fonts", () => {
return gulp
.src("node_modules/bootstrap-sass/assets/fonts/**/*.*")
.pipe(gulp.dest(STATIC_PATH + "/fonts/"));
});
gulp.task("clean", () => {
return del([
STATIC_PATH + "/css/*.*",
STATIC_PATH + "/fonts/*.*",
"!*/__pycache__/*",
]); // Ignore __pycache__ so builds don't error during pip -e installs
});
gulp.task(
"default",
gulp.series(["clean", gulp.parallel(["styles", "fonts"])])
);