Skip to content

Commit

Permalink
Added imagemin, made some improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
N-a-r-w-i-n committed May 18, 2018
1 parent 80d7fc3 commit 464c770
Show file tree
Hide file tree
Showing 2,016 changed files with 196,328 additions and 42 deletions.
31 changes: 28 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ var gulp = require('gulp'),
sourceMap = require('gulp-sourcemaps'),
rename = require('gulp-rename'),
plumber = require('gulp-plumber'),
uglifyJS = require('gulp-uglify');
uglifyJS = require('gulp-uglify'),
imagemin = require('gulp-imagemin');

var config = {
imgSRC: './src/assets/images/*',
imgDEST: './dist/assets/images',
sassSRC: './src/assets/sass/*.sass',
sassDEST: './dist/assets/sass',
jsSRC: './src/assets/javascripts/*.js',
Expand All @@ -24,7 +27,7 @@ var config = {
htmlDEST: './dist',
}

// Performing taks like compiling sass, auto prefixing, sourcemap writting, minifying css, reloading broswer tab...
// Performing taks like compiling sass, auto prefixing, sourcemap writting, minifying css, minifying images, reloading broswer tab...

gulp.task('performActions', function() {
gulp.src(config.sassSRC)
Expand Down Expand Up @@ -53,6 +56,28 @@ gulp.task('performActions', function() {
collapseWhitespace: true
}))
.pipe(gulp.dest(config.htmlDEST))
gulp.src(config.imgSRC)
.pipe(imagemin([
imagemin.gifsicle({
interlaced: true
}),
imagemin.jpegtran({
progressive: true
}),
imagemin.optipng({
optimizationLevel: 5
}),
imagemin.svgo({
plugins: [{
removeViewBox: true
},
{
cleanupIDs: false
}
]
})
]))
.pipe(gulp.dest(config.imgDEST))
gulp.src(config.sassSRC)
.pipe(plumber())
.pipe(gulp.dest(config.sassDEST))
Expand Down Expand Up @@ -86,7 +111,7 @@ gulp.task('uglify', function() {
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: "./src/",
baseDir: "./dist/",
files: [config.cssSRC, config.jsSRC]
},
// Reload the same opened tab.
Expand Down
15 changes: 15 additions & 0 deletions node_modules/.bin/bin-version-check

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/bin-version-check.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/esparse

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/esparse.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/esvalidate

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/esvalidate.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/executable

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/executable.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/find-versions

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/find-versions.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/gifsicle

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/gifsicle.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/jpegtran

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/jpegtran.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/js-yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/js-yaml.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/lpad-align

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/lpad-align.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/optipng

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/optipng.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/rc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/rc.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/seek-bunzip

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/seek-bunzip.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/seek-table

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/.bin/seek-table.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 464c770

Please sign in to comment.