Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Added imagemin to gulp #1104

Merged
merged 1 commit into from
Jan 14, 2016
Merged

Added imagemin to gulp #1104

merged 1 commit into from
Jan 14, 2016

Conversation

accraze
Copy link
Contributor

@accraze accraze commented Dec 15, 2015

This PR is in reference to #1066 (Grunt/Gulp tasks)

in order to minify images in the build process,
gulp is now given an imagemin task.

@lirantal
Copy link
Member

LGTM but needs a review from gulp users

@roboflank
Copy link

👍

@@ -92,6 +92,7 @@
"gulp-csslint": "~0.1.5",
"gulp-cssmin": "~0.1.7",
"gulp-eslint": "~1.0.0",
"gulp-imagemin": "2.4.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~

@ilanbiala
Copy link
Member

Which task runs this? By default, I think it makes sense to have a build/dist task include this, no?

@@ -35,6 +35,9 @@ module.exports = {
'modules/*/client/*.js',
'modules/*/client/**/*.js'
],
img: [
'modules/users/client/img/**/*.png'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want to support minifying .png?

@mleanos
Copy link
Member

mleanos commented Dec 16, 2015

+1 on adding this to the build task.

@accraze
Copy link
Contributor Author

accraze commented Dec 20, 2015

thanks for the feedback guys! I added imagemin to the build task and added support for all img file types.... let me know if anything else needs changing 😁

@@ -35,6 +35,9 @@ module.exports = {
'modules/*/client/*.js',
'modules/*/client/**/*.js'
],
img: [
'modules/**/**/img/**/*'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can still specify specific images, I'd rather not just let this bluntly run on any file in there because there may be user error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok... should we just only handle .png, .jpg, .gif and .ico file types?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle whichever ones the png library supports? Anything else and we may have an error, so we can just avoid that by using the multiple term matching syntax, which I think is (abc|xyz|def), but verify that.

@rhutchison
Copy link
Contributor

Ok, so we compress images as part of the build process - wasted disk space and build time. nothing is even referencing these files right now. Why does this need to be a part of the build process? Seems a bit opinionated? Configuration is way too broad. What if I don't care to compress my images?

I really feel like this would be better served as a utility, not part of the build process - one offs.

@@ -11,9 +11,11 @@ var _ = require('lodash'),
runSequence = require('run-sequence'),
plugins = gulpLoadPlugins({
rename: {
'gulp-angular-templatecache': 'templateCache'
'gulp-angular-templatecache': 'templateCache',
'gulp-imagemin': 'imagemin'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not required

@ilanbiala
Copy link
Member

@accraze any progress on this?

@ilanbiala
Copy link
Member

@accraze can you finalize this PR?

@accraze
Copy link
Contributor Author

accraze commented Jan 10, 2016

sure no prob... did we ever reach a consensus on whether or not to include imagemin in the build task? I hear what @rhutchison is saying about it being opinionated... i could go either way... some projects won't really need imagemin...

Aside from the coveralls issues, imagemin is ready to go and supports jpg, png, gif and svg. Will send a fix later today

@mleanos
Copy link
Member

mleanos commented Jan 10, 2016

Let's not add it to the build task. Someone could easily add it to the build sequence if they wish to.

@accraze
Copy link
Contributor Author

accraze commented Jan 11, 2016

cool... removed imagemin from the build task, fixed the coveralls issue and squashed all the commits... lemme know if you guys need anything else

@mleanos
Copy link
Member

mleanos commented Jan 11, 2016

Looks like there's quite a bit of diffs that have already been merged into master. You'll need to rebase and then squash.

@ilanbiala
Copy link
Member

Are all the new changes because you merged to resolve conflicts?

@accraze
Copy link
Contributor Author

accraze commented Jan 11, 2016

yeah sorry I should have mentioned.... I had to merge master in order to get the coveralls tests to pass... it was failing due to missing test coverage.

@ilanbiala
Copy link
Member

@accraze can you try doing what @mleanos mentioned so that we can have only the necessary changes in this PR. Otherwise merging this in makes it look like a lot was changed.

@accraze
Copy link
Contributor Author

accraze commented Jan 11, 2016

yeah no prob... will fix later this evening

@mleanos
Copy link
Member

mleanos commented Jan 11, 2016

@accraze I'll be on Gitter meanjs most of the day & evening, if you need tips on doing the rebase.

@accraze
Copy link
Contributor Author

accraze commented Jan 13, 2016

took the merge commits out with a rebase last night... should be good to go

@mleanos
Copy link
Member

mleanos commented Jan 13, 2016

LGTM. @ilanbiala @rhutchison

@@ -35,6 +35,12 @@ module.exports = {
'modules/*/client/*.js',
'modules/*/client/**/*.js'
],
img: [
'modules/**/**/img/**/*.jpg',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd double asterisk is unnecessary, just single asterisk.

@ilanbiala
Copy link
Member

Nice, just 2 fixes then I'll merge.

in order to minify images,
gulp is now given an imagemin task
@accraze
Copy link
Contributor Author

accraze commented Jan 14, 2016

@ilanbiala... fixed!

ilanbiala added a commit that referenced this pull request Jan 14, 2016
@ilanbiala ilanbiala merged commit bf05dbc into meanjs:master Jan 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants