-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from ilovepdf/develop
v2.0.3
- Loading branch information
Showing
14 changed files
with
138 additions
and
140 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
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
import gulp from 'gulp'; | ||
import gulpSass from 'gulp-sass'; | ||
import cleanCSS from 'gulp-clean-css'; | ||
import autoprefixer from 'gulp-autoprefixer'; | ||
import * as sassCompiler from 'sass'; | ||
import uglify from 'gulp-uglify'; | ||
import rename from 'gulp-rename'; | ||
import merge from 'merge-stream'; | ||
|
||
const sass = gulpSass(sassCompiler); | ||
|
||
// Task to compile Sass and minify CSS | ||
gulp.task('build-css', function() { | ||
return gulp.src('dev/scss/**/*.scss') | ||
.pipe(sass.sync().on('error', sass.logError)) | ||
.pipe(autoprefixer({ | ||
overrideBrowserslist: ["last 2 versions"], | ||
cascade: false, | ||
})) | ||
.pipe(cleanCSS()) | ||
.pipe(rename({ suffix: '.min' })) | ||
.pipe(gulp.dest('assets/css')); | ||
}); | ||
|
||
// Task to compile and minify JavaScript | ||
gulp.task('build-js', function() { | ||
// Process main.js in this file you can import others files js | ||
const mainJsStream = gulp.src('dev/js/main.js') | ||
.pipe(uglify()) | ||
.pipe(rename({ suffix: '.min' })) // Rename file to main.min.js | ||
.pipe(gulp.dest('assets/js')); | ||
|
||
// Return a merged stream to signal completion | ||
return merge(mainJsStream); | ||
}); | ||
|
||
// Task to watch for changes in Sass files | ||
gulp.task('watch', function() { | ||
gulp.watch('dev/scss/**/*.scss', gulp.series('build-css')); | ||
gulp.watch('dev/js/**/*.js', gulp.series('build-js')); | ||
}); | ||
|
||
// Default task | ||
gulp.task('default', gulp.series('build-css', 'build-js', 'watch')); |
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
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,21 @@ | ||
{ | ||
"name": "iloveimg-wp-compress", | ||
"version": "1.0.0", | ||
"description": "=== Best Compress - Get your images delivered quickly. Now you can get a powerful, easy to use, and reliable image compression plugin for your image optimization needs. With full automation and powerful features, iLoveIMG makes it easy to speed up your website by lightening past and new images with just a click. Compress JPG, PNG and GIF images in your WordPress to improve the positioning of your site, boost visitor’s engagement and ultimately increase sales.", | ||
"main": "index.js", | ||
"scripts": { | ||
"dev": "gulp" | ||
}, | ||
"author": "ilovepdf", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"gulp": "^4.0.2", | ||
"gulp-autoprefixer": "^9.0.0", | ||
"gulp-clean-css": "^4.3.0", | ||
"gulp-rename": "^2.0.0", | ||
"gulp-sass": "^5.1.0", | ||
"gulp-uglify": "^3.0.2", | ||
"merge-stream": "^2.0.0", | ||
"sass": "^1.71.1" | ||
} | ||
} |
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
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
Oops, something went wrong.