-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e139c09
commit 0859cce
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const gulp = require("gulp"); | ||
const cleanCSS = require("gulp-clean-css"); | ||
const concat = require("gulp-concat"); | ||
const uglify = require("gulp-uglify"); | ||
const sass = require("gulp-sass")(require("sass")); | ||
|
||
// Compile SCSS to CSS and minify | ||
gulp.task("styles", function () { | ||
return gulp | ||
.src("src/scss/**/*.scss") // Source SCSS files | ||
.pipe(sass().on("error", sass.logError)) // Compile SCSS | ||
.pipe(cleanCSS()) // Minify CSS | ||
.pipe(concat("styles.min.css")) // Merge into one file | ||
.pipe(gulp.dest("dist/css")); // Save output | ||
}); | ||
|
||
// Minify and concatenate JavaScript | ||
gulp.task("scripts", function () { | ||
return gulp | ||
.src("src/js/**/*.js") // Source JS files | ||
.pipe(uglify()) // Minify JS | ||
.pipe(concat("scripts.min.js")) // Merge into one file | ||
.pipe(gulp.dest("dist/js")); // Save output | ||
}); | ||
|
||
// Default task (runs all tasks) | ||
gulp.task("default", gulp.parallel("styles", "scripts")); |