Skip to content

Commit

Permalink
Update gulp file
Browse files Browse the repository at this point in the history
  • Loading branch information
sylhare committed Mar 1, 2023
1 parent 9b1ba4a commit f1acea2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions assets/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/*
* Here are all of the gulp tasks you can use to help manage your blog
* Here are all the gulp tasks you can use to help manage your blog
* Use `npm install` to install all the dependencies located in package.json
* If you have an issue with sharp, try: `npm rebuild`.
* Then `gulp default` to minimize css and images.
*/
const gulp = require('gulp');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const imagemin = require('gulp-imagemin');
const uglify = require('gulp-uglify-es').default;
const less = require('gulp-less');
const cleanCSS = require('gulp-clean-css');
const replace = require('gulp-replace');
Expand Down Expand Up @@ -41,9 +40,11 @@ gulp.task('js', function minijs() {
.pipe(gulp.dest("js/"))
});

gulp.task("img", function imging() {
gulp.task("img", async function imging() {
const imagemin = await import('gulp-imagemin');

return gulp.src('img/**/*.{png,svg,jpg,webp,jpeg,gif}')
.pipe(imagemin())
.pipe(imagemin.default())
.on('error', (err) => {
console.log(err.toString())
})
Expand Down
10 changes: 5 additions & 5 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
"url": "https://github.com/Sylhare/Type-on-Strap/issues"
},
"homepage": "https://github.com/sylhare/Type-on-Strap#readme",
"engines" : {
"node" : ">=12.0.0 <16.0.0"
"engines": {
"node": ">=12.0.0 <16.0.0"
},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.6.1",
"gulp-imagemin": "^7.1.0",
"gulp-imagemin": "^8.0.0",
"gulp-less": "^5.0.0",
"gulp-replace": "^1.1.3",
"gulp-replace": "^1.1.4",
"gulp-responsive": "^3.0.1",
"gulp-uglify": "^3.0.2",
"gulp-uglify-es": "^3.0.0",
"gulp-webp": "^4.0.1"
}
}

0 comments on commit f1acea2

Please sign in to comment.