grunt-uncss icon indicating copy to clipboard operation
grunt-uncss copied to clipboard

Improve README with "on top of stack" info

Open franz-josef-kaiser opened this issue 11 years ago • 6 comments

I just set up grunt-uncss alongside processhtml. Task order was:

  1. CSS Preprocessor > Cache folder
  2. UnCSS > Cache folder (again)
  3. Minify > Deploy folder

as it felt quite unnecessary to drop processhtml in just satisfy a workflow that I wasn't using, I tried running in the deploy folder on the minified result. And it was great, as the result was an even (slightly) smaller file. On top of that, I just dropped it into my stack/task list at the top/end and haven't had to modify anything just to fit it in. Now the task order is

  1. CSS Preprocessor > Cache folder
  2. Minify > Deploy folder
  3. UnCSS on minified file > Deploy folder

I'm in the opinion that an explanation about this (most basic and easy) usage should be added to the README.

franz-josef-kaiser avatar Jun 21 '14 18:06 franz-josef-kaiser

I fully agree :) I'll probably get to this sometime next week but if you'd like to take a stab at refining the readme before that a PR would most definitely be welcome. Thanks for bringing this up!

addyosmani avatar Jun 21 '14 19:06 addyosmani

I tend to stay away from writing docs that aren't for my own projects as I'm no native speaker. But thanks for trusting me on that one - you would regret it ;)

franz-josef-kaiser avatar Jun 21 '14 19:06 franz-josef-kaiser

IMO, uncss should always come before the final minifcation. Especially if you are using clean-css which does some fancy stuff.

In one of my projects I do this personally:

 grunt.registerTask("build", [
  "clean",
  "jekyll",
  "useminPrepare",
  "copy",
  "concat",
  "uncss",
  "cssmin",
  "uglify",
  "filerev",
  "usemin",
  "htmlmin"
]);

XhmikosR avatar Oct 03 '14 11:10 XhmikosR

I'd be happy for us to provide more guidance around this in the README. Perhaps..

(Optional: compile Sass/Less/Stylus to CSS) -> CSS -> UnCSS -> Minify ?

addyosmani avatar Oct 03 '14 15:10 addyosmani

@addyosmani: sounds good, yeah. Maybe in a section named "Suggested workflow" or something?

XhmikosR avatar Oct 03 '14 15:10 XhmikosR

Sgtm!

addyosmani avatar Oct 03 '14 16:10 addyosmani