forked from xiaogliu/pure-full-page
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
42 lines (37 loc) · 1.01 KB
/
gulpfile.babel.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
import gulp from "gulp";
import babel from "gulp-babel";
import uglify from "gulp-uglify";
import concat from "gulp-concat";
import cleanCSS from "gulp-clean-css";
import sass from "gulp-sass";
import rename from "gulp-rename";
const paths = {
styles: {
src: "./src/css/pureFullPage.scss",
dest: "./dist",
},
scripts: {
src: ["./src/js/utils.js", "./src/js/pureFullPage.js"],
dest: "./dist",
},
};
const transferCSS = () =>
gulp
.src(paths.styles.src)
.pipe(sass().on("error", sass.logError))
.pipe(cleanCSS({ compatibility: "*" }))
.pipe(rename("pureFullPage.min.css"))
.pipe(gulp.dest(paths.styles.dest));
const transferJS = () =>
gulp
.src(paths.scripts.src)
.pipe(concat("pureFullPage.min.js"))
.pipe(babel())
.pipe(uglify())
.pipe(gulp.dest(paths.scripts.dest));
export const watch = () => {
gulp.watch(paths.styles.src, transferCSS);
gulp.watch(paths.scripts.src, transferJS);
};
// build files
export const build = gulp.parallel(transferCSS, transferJS);