Skip to content

Commit

Permalink
Adding svg minifiaction
Browse files Browse the repository at this point in the history
  • Loading branch information
samliebl committed Sep 21, 2024
1 parent 395708c commit 5d03448
Show file tree
Hide file tree
Showing 3 changed files with 2,391 additions and 65 deletions.
12 changes: 11 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import cleanCSS from 'gulp-clean-css';
import gulpHeader from 'gulp-header';
import plumber from 'gulp-plumber';
import htmlmin from 'gulp-htmlmin';
import svgo from 'gulp-svgo';
import gulpSass from 'gulp-sass';
import rename from 'gulp-rename';

Expand All @@ -32,7 +33,10 @@ const paths = {
scss: 'src/sass/**/*.scss',
cssdest: 'dist/css',
tmpl: 'src/tmpl/**/*.njk',
tmpldest: 'dist/'
tmpldest: 'dist/',
imgdest: 'dist/img/',
img: 'src/img',
svg: 'src/img/svg/*.svg'
};

// Task to compile SCSS to regular CSS
Expand Down Expand Up @@ -70,6 +74,12 @@ export function nunjucks() {
.pipe(dest(paths.tmpldest))
}

export function optimizeSvg() {
return src(paths.svg)
.pipe(svgo())
.pipe(dest(paths.imgdest))
}

// Watch SCSS files and run the tasks automatically on change
export function watchFiles() {
watch([
Expand Down
Loading

0 comments on commit 5d03448

Please sign in to comment.