forked from NicerWritter27/web-pacman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (28 loc) · 841 Bytes
/
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
const gulp = require("gulp");
const gulpSass = require("gulp-sass");
const sass = require("sass");
const concat = require("gulp-concat");
const removeCode = require("gulp-remove-code");
// Configure gulp-sass to use dart-sass
const sassCompiler = gulpSass(sass);
function styles() {
return gulp
.src("app/style/scss/**/*.scss")
.pipe(sassCompiler().on("error", sassCompiler.logError))
.pipe(concat("app.css"))
.pipe(gulp.dest("build"));
}
function scripts() {
return gulp
.src("app/scripts/**/*.js")
.pipe(removeCode({ production: true }))
.pipe(concat("app.js"))
.pipe(gulp.dest("build"));
}
function watch() {
gulp.watch("app/style/**/*.scss", styles);
gulp.watch("app/scripts/**/*.js", scripts);
}
const build = gulp.parallel(styles, scripts);
exports.watch = watch;
exports.default = build;