minimart icon indicating copy to clipboard operation
minimart copied to clipboard

Minify CSS and JS in HTMLGenerator

Open tapickell opened this issue 9 years ago • 4 comments

Just an idea that could simplify things a bit.

Currently we have rake tasks compile_js and compile_css https://github.com/electric-it/minimart/blob/master/Rakefile#L18-L44 That will uglify and minify the JS and CSS files from the _assets dir to the assets dir. In the HTMLGenerator class we are copying those assets over into the web directory as part of the static site creation. https://github.com/electric-it/minimart/blob/master/lib/minimart/web/html_generator.rb#L34

It seems like this may be a good place to have it minify & uglify the CSS and JS files for us during the site generation process instead of relying on the rake task.

What do you think @richardardrichard @ge1st @berniedurfee-ge

tapickell avatar Dec 21 '15 14:12 tapickell

I honestly don't have a good reason why it's not a part of that already...

richardardrichard avatar Dec 21 '15 14:12 richardardrichard

Cool, I looked at that and was just like, hmmm.... why aren't we doing that.

tapickell avatar Dec 21 '15 14:12 tapickell

I will work on adding that today.

tapickell avatar Dec 21 '15 14:12 tapickell

I think I was trying to avoid adding those things as dependencies... which doesn't really make sense at all.... so :+1:

richardardrichard avatar Dec 21 '15 14:12 richardardrichard