Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sass, Watch, Livereload and Notify to Gruntfile #27

Merged
merged 2 commits into from
Oct 20, 2013
Merged

Add Sass, Watch, Livereload and Notify to Gruntfile #27

merged 2 commits into from
Oct 20, 2013

Conversation

lewismorris
Copy link

Hey Guys,

I've dropped in the Sass compiler inside a watch task along with Livereload and Notify.

Let me know of any feedback.

@markgoodyear
Copy link

Hey @lewismorris,

I'd suggest adding in matchdep to save adding the node modules manually in the Gruntfile.

What do you think on these options too:

  • Autoprefixer—awesome tool, saves using mixins for generating vendor prefixes
  • JSHint
  • Concat JS files (either from a folder or add manually to the Gruntfile to control the order)
  • Uglify (minify)
  • Image compression

I've a repo with all that set up if you want nick things out of it :)

@lewismorris
Copy link
Author

Hey @markgoodyear

I'll take a look at matchdep.

  • Would this not be best being left to something like Bourbon when writing your css?
  • All the others are in line to be brought added in the future

Between myself, @Passenger-Inspired and @timgale we agreed on trying to use as many grunt-contrib plugins as possible, not sure what your thoughts are on this? We come to the conclusion this would be the most future proof method as these plugins appear to be better maintained.

@markgoodyear
Copy link

Regarding Autoprefixer, I thought that at first, changed my mind when I tried it. It allows to write native CSS, and Autoprefixer just appended the necessary browser prefixes. If a prefix is no longer required, it won't add them in. You can configure how far back to support too which is great.

Yeah I try to use grunt-contribs as much as possible, though I see no harm in using others too. Often well supported if any issues are there.

@lewismorris
Copy link
Author

Hey Guys,

Any more feedback? Be good to make a start on merging back into the main boilerplate.

@jonspark
Copy link

Not familiar with what's being discussed but, from the sounds, there could be some crossover with #12 on the JS side of things.

I know it's a bit early to be talking the cut-down version of the rules, but this seems pretty advanced for anyone not FE-focussed. How far would this be taken with a server-side dev?

@BenjaminRCooper
Copy link
Contributor

@jonspark - not at all mate.

Myself, @lewismorris and @timgale are just making a start on some of the tooling required for the boilerplate.

We are looking to implement base files and workflows for Grunt, Require JS and Bower.

B

@markgoodyear
Copy link

Hey guys,

Just want to share some findings regarding a Sass set-up.

Currently I have Sass being compiled to global.css. This is then ran through Autoprefixer too automatically add in vendor prefixes—should they be needed. After this, it is then minified by CSS min to global.min.css.

This means there is a uncompressed and compressed version generated. I find this useful when developing in WordPress as I use a switch to detect the environment and load in the .min.css version on the live server, and .css for dev, meaning I can just run grunt watch and forget about running a dev/production task to minify. The minifying can be also done in a separate production task though.

Any thoughts?

@BenjaminRCooper
Copy link
Contributor

Morning guys,

Hope you are both well.

@lewismorris - This is a great start mate, I think this is good to merge. @timgale do you agree?

@markgoodyear - Thanks for this, this sounds like something we should definitely have in our document. Do you think you could look to incorporate this into the boilerplate? Just one thing to add, we are going to use main.min.css and main.css.

With regards to moving forward, I would like to see if we can add the following;

What you guys think?

B

@markgoodyear
Copy link

Hey Ben,

Sure, I'll wait on a merge before implementing. Switched over to use main instead of global too.

Regarding JS concat/minify, what do you prefer:

  1. Concat and minify a folder
  2. Specify in the Gruntfile files to be concatenated and minified

I've tried both ways, so far using number 2 so I can specify order of the scripts. A little more maintenance as a downside though.

I've not tried those two plugins, but I'll check them out :)

Mark

@timgale
Copy link

timgale commented Oct 18, 2013

Morning chaps

This is looking good to me.

One area I would say requires more attention is, as @markgoodyear brought up, image compression. I think it would be worth adding in the ImageOptim plugin, as this also provides support for ImageAlpha and JPEGmini.

+1 for @Passenger-Inspired's suggestion of adding Grunt Newer to help with performance.

Tim

@markgoodyear
Copy link

Grunt newer might not be needed as watch can do this too: https://github.com/gruntjs/grunt-contrib-watch#compiling-files-as-needed. Might try that as it's only really JS files that need it when being linted, I think?

For image optimisation, I use the "contrib" plugin imagemin which does gif, jpg, png (transparency supported too). It's also clever enough not to compress the same image if it's already been compressed. I'm not sure the differences between the two plugins are.

BenjaminRCooper added a commit that referenced this pull request Oct 20, 2013
Add Sass, Watch, Livereload and Notify to Gruntfile
@BenjaminRCooper BenjaminRCooper merged commit 8d8ca42 into Clicksco:boilerplate Oct 20, 2013
@BenjaminRCooper
Copy link
Contributor

@timgale, @lewismorris - What are your thoughts regarding Mark's work?

@markgoodyear - Great stuff mate, +1 from me.

B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants